Spec-Zone.ru › TensorFlow

tf.types.experimental.AtomicFunction

Base class for graph functions.

Inherits From: Callable

An AtomicFunction encapsulates a single graph function definition.

AtomicFunction can be called directly only if no captures are needed according to the FunctionType. If captures are present, please use call_with_captures instead.

AtomicFunction does not support gradients. Please use the parent ConcreteFunction if you need gradient support.

Attributes
function_type Returns a FunctionType describing this callable.

Methods

call_with_captures

View source

call_with_captures(
    args, kwargs, captures
)

Calls this AtomicFunction with captures as defined by its FunctionType.

Args
args Tuple containing positional arguments
kwargs Dict containing keyword arguments
captures Tuple of tensors supplying captured tensor values.
Returns
A structured output value based on the inputs.

__call__

View source

__call__(
    *args, **kwargs
)

Executes this callable.

This behaves like a regular op - in eager mode, it immediately starts execution, returning results. In graph mode, it creates ops which return symbolic TensorFlow values (like tf.Tensor, tf.data.Dataset, etc.). For example, tf.function callables typically generate a tf.raw_ops.PartitionedCall op, but not always - the exact operations being generated are an internal implementation detail.

Args
*args positional argument for this call
**kwargs keyword arguments for this call
Returns
The execution results.

© 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/AtomicFunction

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API