Skip to content

Commit

Permalink
Adding stop_gradient back since it is now available in ops. (#20353)
Browse files Browse the repository at this point in the history
  • Loading branch information
dryglicki authored Oct 14, 2024
1 parent ea70d1f commit 3de677e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras/src/layers/normalization/spectral_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def normalized_weights(self):
ops.matmul(vector_u, ops.transpose(weights)), axis=None
)
vector_u = normalize(ops.matmul(vector_v, weights), axis=None)
# vector_u = tf.stop_gradient(vector_u)
# vector_v = tf.stop_gradient(vector_v)
vector_u = ops.stop_gradient(vector_u)
vector_v = ops.stop_gradient(vector_v)
sigma = ops.matmul(
ops.matmul(vector_v, weights), ops.transpose(vector_u)
)
Expand Down

0 comments on commit 3de677e

Please sign in to comment.