diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py index eceb9ae43bc..a41fcee2e97 100644 --- a/tensorflow/python/framework/ops.py +++ b/tensorflow/python/framework/ops.py @@ -620,14 +620,14 @@ class Tensor(tensor_like.TensorLike): The shape inference functions propagate shapes to the extent possible: - >>> _ = my_matmul.get_concrete_function( + >>> f = my_matmul.get_concrete_function( ... tf.TensorSpec([None,3]), ... tf.TensorSpec([3,5])) Result shape: (None, 5) Tracing may fail if a shape missmatch can be detected: - >>> _ = my_matmul.get_concrete_function( + >>> cf = my_matmul.get_concrete_function( ... tf.TensorSpec([None,3]), ... tf.TensorSpec([4,5])) Traceback (most recent call last): @@ -647,7 +647,7 @@ class Tensor(tensor_like.TensorLike): ... print("Result shape: ", a.shape) ... return a - >>> _ = my_fun.get_concrete_function( + >>> cf = my_fun.get_concrete_function( ... tf.TensorSpec([None, None])) Result shape: (5, 5) @@ -712,7 +712,7 @@ class Tensor(tensor_like.TensorLike): Trace the function, see the [Concrete Functions Guide](https://www.tensorflow.org/guide/concrete_function) for details. - >>> _ = load_image.get_concrete_function( + >>> cf = load_image.get_concrete_function( ... tf.TensorSpec([], dtype=tf.string)) Initial shape: (None, None, 3) Final shape: (28, 28, 3) diff --git a/tensorflow/python/keras/backend.py b/tensorflow/python/keras/backend.py index 35ef8def6d8..dd95d51cd10 100644 --- a/tensorflow/python/keras/backend.py +++ b/tensorflow/python/keras/backend.py @@ -3296,11 +3296,11 @@ _VALUE_SET_CODE_STRING = """ >>> v = tf.Variable(1.) - >>> _ = v.assign(2.) + >>> v.assign(2.) >>> print(v.numpy()) 2.0 - >>> _ = v.assign_add(1.) + >>> v.assign_add(1.) >>> print(v.numpy()) 3.0"""[3:] # Prune first newline and indent to match the docstring template. diff --git a/tensorflow/python/keras/engine/training.py b/tensorflow/python/keras/engine/training.py index 14c4dad34e5..c7ea1fe0ca1 100644 --- a/tensorflow/python/keras/engine/training.py +++ b/tensorflow/python/keras/engine/training.py @@ -416,7 +416,7 @@ class Model(network.Network, version_utils.ModelVersionSelector): >>> x = np.random.random((2, 3)) >>> y = np.random.randint(0, 2, (2, 2)) - >>> _ = model.fit(x, y, verbose=0) + >>> model.fit(x, y, verbose=0) >>> [m.name for m in model.metrics] ['loss', 'mae'] @@ -429,7 +429,7 @@ class Model(network.Network, version_utils.ModelVersionSelector): >>> model.add_metric( ... tf.reduce_sum(output_2), name='mean', aggregation='mean') >>> model.compile(optimizer="Adam", loss="mse", metrics=["mae", "acc"]) - >>> _ = model.fit(x, (y, y), verbose=0) + >>> model.fit(x, (y, y), verbose=0) >>> [m.name for m in model.metrics] ['loss', 'out_loss', 'out_1_loss', 'out_mae', 'out_acc', 'out_1_mae', 'out_1_acc', 'mean']