tf.types.experimental.ConcreteFunction
Stay organized with collections
Save and categorize content based on your preferences.
Base class for differentiable graph functions.
Inherits From: Callable
A ConcreteFunction
encapsulates the original graph function definition with
support for differentiability under tf.GradientTape
contexts. In the
process, it may generate new graph functions (using the original) to
efficiently perform forwards and backwards passes.
Attributes |
function_type
|
Returns a FunctionType describing this callable.
|
inference_fn
|
Returns the original AtomicFunction owned by this ConcreteFunction.
|
Methods
__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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.types.experimental.ConcreteFunction\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/types/core.py#L169-L182) |\n\nBase class for differentiable graph functions.\n\nInherits From: [`Callable`](../../../tf/types/experimental/Callable)\n\nA `ConcreteFunction` encapsulates the original graph function definition with\nsupport for differentiability under [`tf.GradientTape`](../../../tf/GradientTape) contexts. In the\nprocess, it may generate new graph functions (using the original) to\nefficiently perform forwards and backwards passes.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-----------------|-----------------------------------------------------------------------|\n| `function_type` | Returns a FunctionType describing this callable. |\n| `inference_fn` | Returns the original `AtomicFunction` owned by this ConcreteFunction. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `__call__`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/types/core.py#L124-L139) \n\n __call__(\n *args, **kwargs\n )\n\nExecutes this callable.\n\nThis behaves like a regular op - in eager mode, it immediately starts\nexecution, returning results. In graph mode, it creates ops which return\nsymbolic TensorFlow values (like [`tf.Tensor`](../../../tf/Tensor), [`tf.data.Dataset`](../../../tf/data/Dataset),\netc.). For example, [`tf.function`](../../../tf/function) callables typically generate a\n[`tf.raw_ops.PartitionedCall`](../../../tf/raw_ops/PartitionedCall) op, but not always - the\nexact operations being generated are an internal implementation detail.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|-----------------------------------|\n| `*args` | positional argument for this call |\n| `**kwargs` | keyword arguments for this call |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| The execution results. ||\n\n\u003cbr /\u003e"]]