Skip to content

Commit 8073dcb

Browse files
Update keras_rs/src/layers/hstu_compute_output.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent c80e598 commit 8073dcb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

keras_rs/src/layers/hstu_compute_output.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ def keras_norm_mul_dropout(
3131
raise NotImplementedError("Group Norm path not suitable for simple Keras ops conversion.")
3232
else:
3333
# Functional Layer Normalization (Simulated keras_layer_norm)
34-
mean = ops.mean(x, axis=-1, keepdims=True)
35-
variance = ops.mean(ops.square(x - mean), axis=-1, keepdims=True)
36-
x_norm = (x - mean) / ops.sqrt(variance + eps)
34+
x_norm = ops.layer_norm(x, axis=-1, epsilon=eps)
3735

3836
# Apply weight and bias (Gamma * x_norm + Beta)
3937
y_norm = x_norm * weight + bias

0 commit comments

Comments
 (0)