tf.types.experimental.FunctionType

Represents the type of a TensorFlow callable.

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.types.experimental.FunctionType

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:

  • Canonicalization and type-checking of Python input arguments
  • Type-based dispatch to concrete functions
  • Packing/unpacking structured python values to Tensors
  • Generation of structured placeholder values for tracing

parameters

return_annotation

Child Classes

class empty

Methods

bind

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_partial

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

Constructs Signature for the given builtin function.

Deprecated since Python 3.5, use Signature.from_callable().

from_callable

View source

Constructs Signature for the given callable object.

from_function

Constructs Signature for the given python function.

Deprecated since Python 3.5, use Signature.from_callable().

replace

Creates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy.

__eq__

Return self==value.