Represents the type of a TensorFlow callable.
tf.types.experimental.FunctionType(
parameters=None, *, return_annotation, __validate_parameters__=True
)
FunctionType inherits from inspect.Signature which canonically represents the structure (and optionally type) information of input parameters and output of a Python function. Additionally, it integrates with the tf.function type system (tf.types.experimental.TraceType) to provide a holistic representation of the the I/O contract of the callable. It is used for:
| Attributes | |
|---|---|
parameters | |
return_annotation | |
bindbind(
*args, **kwargs
)
Get a BoundArguments object, that maps the passed args and kwargs to the function's signature. Raises TypeError if the passed arguments can not be bound.
bind_partialbind_partial(
*args, **kwargs
)
Get a BoundArguments object, that partially maps the passed args and kwargs to the function's signature. Raises TypeError if the passed arguments can not be bound.
from_builtin@classmethod
from_builtin(
func
)
Constructs Signature for the given builtin function.
Deprecated since Python 3.5, use Signature.from_callable().
from_callable@classmethod
from_callable(
obj, *, follow_wrapped=True
)
Constructs Signature for the given callable object.
from_function@classmethod
from_function(
func
)
Constructs Signature for the given python function.
Deprecated since Python 3.5, use Signature.from_callable().
replacereplace(
*, parameters=_void, return_annotation=_void
)
Creates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy.
__eq____eq__(
other
)
Return self==value.
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/types/experimental/FunctionType