Enable type annotations for python/ops.

PiperOrigin-RevId: 317779660
Change-Id: Ife6b7319ef394b611798f5d01b64ebdb3c0a01cc
This commit is contained in:
Dan Moldovan 2020-06-22 18:46:12 -07:00 committed by TensorFlower Gardener
parent 265de52331
commit d8b90acf95

View File

@ -54,11 +54,9 @@ except NameError:
# call relies on certain conditionals for its dependencies. Use
# control_flow_ops.Assert.
# Assert and Print are special symbols in python, so we must
# have an upper-case version of them.
#
# For users with Python 3 or Python 2.7
# with `from __future__ import print_function`, we could also allow lowercase.
# Assert and Print are special symbols in Python 2, so we must
# have an upper-case version of them. When support for it is dropped,
# we can allow lowercase.
# See https://github.com/tensorflow/tensorflow/issues/18053
@ -83,11 +81,6 @@ def Print(input_, data, message=None, first_n=None, summarize=None, name=None):
with jupyter notebook (printing to the notebook *server's* output, not into
the notebook).
Additionally, to use tf.print in python 2.7, users must make sure to import
the following:
`from __future__ import print_function`
Args:
input_: A tensor passed through this op.
data: A list of tensors to print out when op is evaluated.
@ -148,11 +141,6 @@ def print_v2(*inputs, **kwargs):
Python objects. Printed tensors will recursively show the first and last
elements of each dimension to summarize.
@compatibility(python2)
In python 2.7, make sure to import the following:
`from __future__ import print_function`
@end_compatibility
Example:
Single-input usage: