Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nitpick: fix bullet point formatting in docs for Tout arg of tf.py_function #66573

Merged
merged 1 commit into from May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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