Enable type annotations for python/ops.

PiperOrigin-RevId: 317229132
Change-Id: I7055e650308c2fc83969385dd25e86fb5b073d75
This commit is contained in:
Dan Moldovan 2020-06-18 19:08:04 -07:00 committed by TensorFlower Gardener
parent 723751b20e
commit b7edd44ee0

View File

@ -54,11 +54,9 @@ except NameError:
# call relies on certain conditionals for its dependencies. Use # call relies on certain conditionals for its dependencies. Use
# control_flow_ops.Assert. # control_flow_ops.Assert.
# Assert and Print are special symbols in python, so we must # Assert and Print are special symbols in Python 2, so we must
# have an upper-case version of them. # have an upper-case version of them. When support for it is dropped,
# # we can allow lowercase.
# For users with Python 3 or Python 2.7
# with `from __future__ import print_function`, we could also allow lowercase.
# See https://github.com/tensorflow/tensorflow/issues/18053 # 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 with jupyter notebook (printing to the notebook *server's* output, not into
the notebook). 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: Args:
input_: A tensor passed through this op. input_: A tensor passed through this op.
data: A list of tensors to print out when op is evaluated. 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 Python objects. Printed tensors will recursively show the first and last
elements of each dimension to summarize. 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: Example:
Single-input usage: Single-input usage: