Skip to content

Commit

Permalink
Nitpick: fix bullet point formatting in docs for Tout arg of `tf.py…
Browse files Browse the repository at this point in the history
…_function`

PiperOrigin-RevId: 629854702
  • Loading branch information
tensorflower-gardener committed May 1, 2024
1 parent 56e0707 commit fe0f82f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tensorflow/python/ops/script_ops.py
Expand Up @@ -461,6 +461,9 @@ def py_function_wrapper(*args):
@tf_export("py_function")
@dispatch.add_dispatch_support
def eager_py_func(func=None, inp=None, Tout=None, name=None):
# TODO(b/338268835): Remove "pyformat: disable" and the "pyformat: enable"
# line below if this feature request is implemented.
# pyformat: disable
"""Wraps a python function into a TensorFlow op that executes it eagerly.
Using `tf.py_function` inside a `tf.function` allows you to run a python
Expand Down Expand Up @@ -609,13 +612,13 @@ def eager_py_func(func=None, inp=None, Tout=None, name=None):
`CompositeTensors` (such as `tf.RaggedTensor`); or a single `Tensor` or
`CompositeTensor`. Do not set `inp` when using `tf.py_function` as a
decorator.
Tout: The type(s) of the value(s) returned by `func`. One of the following.
Tout: The type(s) of the value(s) returned by `func`. One of the following:
* If `func` returns a `Tensor` (or a value that can be converted to a
Tensor): the `tf.DType` for that value. * If `func` returns a
`CompositeTensor`: The `tf.TypeSpec` for that value. * If `func` returns
`None`: the empty list (`[]`). * If `func` returns a list of `Tensor` and
`CompositeTensor` values: a corresponding list of `tf.DType`s and
`tf.TypeSpec`s for each value.
Tensor): the `tf.DType` for that value.
* If `func` returns a `CompositeTensor`: The `tf.TypeSpec` for that value.
* If `func` returns `None`: the empty list (`[]`).
* If `func` returns a list of `Tensor` and `CompositeTensor` values: a
corresponding list of `tf.DType`s and `tf.TypeSpec`s for each value.
name: A name for the operation (optional).
Returns:
Expand All @@ -626,6 +629,8 @@ def eager_py_func(func=None, inp=None, Tout=None, name=None):
and returns the result: a `Tensor`, `CompositeTensor`, or list of
`Tensor` and `CompositeTensor`; or an empty list if `func` returns `None`.
"""
# pyformat: enable

decorator = _check_args_and_maybe_make_decorator(
eager_py_func, "tf.py_function", func=func, inp=inp, Tout=Tout, name=name
)
Expand Down

0 comments on commit fe0f82f

Please sign in to comment.