Skip to content

Commit 7e2063e

Browse files
Merge pull request tensorflow#34625 from anuj-rawat:unittest_fix_avx512
PiperOrigin-RevId: 294730950 Change-Id: I7cb7483b6865217b0230873d94c598f055c09496
2 parents eca81d2 + 5670f0f commit 7e2063e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tensorflow/python/keras/backend.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,12 +4547,11 @@ def categorical_crossentropy(target, output, from_logits=False, axis=-1):
45474547
[0.5 0.89 0.6 ]
45484548
[0.05 0.01 0.94]], shape=(3, 3), dtype=float32)
45494549
>>> loss = tf.keras.backend.categorical_crossentropy(a, b)
4550-
>>> print(loss)
4551-
tf.Tensor([0.10536055 0.8046684 0.06187541], shape=(3,), dtype=float32)
4550+
>>> print(np.around(loss, 5))
4551+
[0.10536 0.80467 0.06188]
45524552
>>> loss = tf.keras.backend.categorical_crossentropy(a, a)
4553-
>>> print(loss)
4554-
tf.Tensor([1.1920929e-07 1.1920929e-07 1.1920930e-07], shape=(3,),
4555-
dtype=float32)
4553+
>>> print(np.around(loss, 5))
4554+
[0. 0. 0.]
45564555
45574556
"""
45584557
target.shape.assert_is_compatible_with(output.shape)

0 commit comments

Comments
 (0)