Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
tensoreflusso:: ops:: Barriera
#include <data_flow_ops.h>
Definisce una barriera che persiste tra diverse esecuzioni del grafico.
Riepilogo
Una barriera rappresenta una mappa chiave-valore, dove ogni chiave è una stringa e ogni valore è una tupla di tensori.
In fase di esecuzione, la barriera contiene elementi "completi" e "incompleti". Un elemento completo ha tensori definiti per tutti i componenti della sua tupla di valore ed è possibile accedervi utilizzando BarrierTakeMany . Un elemento incompleto ha alcuni componenti non definiti nella sua tupla di valore e può essere aggiornato utilizzando BarrierInsertMany .
Argomenti:
- scope: un oggetto Scope
- Component_types: il tipo di ciascun componente in un valore.
Attributi facoltativi (vedi Attrs
):
- forme: la forma di ciascun componente in un valore. Ogni forma deve essere 1 nella prima dimensione. La lunghezza di questo attributo deve essere uguale alla lunghezza di Component_Types.
- capacità: La capacità della barriera. La capacità predefinita è MAX_INT32, ovvero la capacità maggiore della coda sottostante.
- contenitore: se non vuota, questa barriera viene posizionata nel contenitore indicato. Altrimenti, viene utilizzato un contenitore predefinito.
- shared_name: se non vuoto, questa barriera verrà condivisa con il nome specificato in più sessioni.
Resi:
-
Output
: La maniglia della barriera.
Attributi pubblici
Funzioni pubbliche
Barriera
Barrier(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
nodo
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operatore::tensorflow::Output
operator::tensorflow::Output() const
Funzioni pubbliche statiche
Capacità
Attrs Capacity(
int64 x
)
Contenitore
Attrs Container(
StringPiece x
)
Forme
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
Nome condiviso
Attrs SharedName(
StringPiece x
)
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[null,null,["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# tensorflow::ops::Barrier Class Reference\n\ntensorflow::ops::Barrier\n========================\n\n`#include \u003cdata_flow_ops.h\u003e`\n\nDefines a barrier that persists across different graph executions.\n\nSummary\n-------\n\nA barrier represents a key-value map, where each key is a string, and each value is a tuple of tensors.\n\nAt runtime, the barrier contains 'complete' and 'incomplete' elements. A complete element has defined tensors for all components of its value tuple, and may be accessed using [BarrierTakeMany](/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many). An incomplete element has some undefined components in its value tuple, and may be updated using [BarrierInsertMany](/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-insert-many#classtensorflow_1_1ops_1_1_barrier_insert_many).\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- component_types: The type of each component in a value.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)):\n\n- shapes: The shape of each component in a value. Each shape must be 1 in the first dimension. The length of this attr must be the same as the length of component_types.\n- capacity: The capacity of the barrier. The default capacity is MAX_INT32, which is the largest capacity of the underlying queue.\n- container: If non-empty, this barrier is placed in the given container. Otherwise, a default container is used.\n- shared_name: If non-empty, this barrier will be shared under the given name across multiple sessions.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The handle to the barrier.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Barrier](#classtensorflow_1_1ops_1_1_barrier_1ae400cc957e34014ea577177c9ee259a7)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, const DataTypeSlice & component_types)` ||\n| [Barrier](#classtensorflow_1_1ops_1_1_barrier_1a16852c2beb26f3659acdabc69c948e91)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, const DataTypeSlice & component_types, const `[Barrier::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [handle](#classtensorflow_1_1ops_1_1_barrier_1a999e0c86fdd1442995bd4dcd49f55f75) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_barrier_1a66ea0f34005305664b3a8c2b7237c73b) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_barrier_1a0572d54a742a10d03a030edd48180865)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_barrier_1a4b6914f3b4916e256dd1b02e731c71b3)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_barrier_1a00b400c1c0d2a50625e5f1deefd7510f)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| [Capacity](#classtensorflow_1_1ops_1_1_barrier_1a393954a81f232e756e680fc9e091595d)`(int64 x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs) |\n| [Container](#classtensorflow_1_1ops_1_1_barrier_1af53271d59cca63c440ef591e790c1a0a)`(StringPiece x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs) |\n| [Shapes](#classtensorflow_1_1ops_1_1_barrier_1a6f503841ebe322db85d2826f56de4fb8)`(const gtl::ArraySlice\u003c PartialTensorShape \u003e & x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs) |\n| [SharedName](#classtensorflow_1_1ops_1_1_barrier_1a704c1a8c990c6afe3854ddc6cf9d3d6e)`(StringPiece x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Barrier::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier/attrs) | Optional attribute setters for [Barrier](/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier#classtensorflow_1_1ops_1_1_barrier). |\n\nPublic attributes\n-----------------\n\n### handle\n\n```text\n::tensorflow::Output handle\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### Barrier\n\n```gdscript\n Barrier(\n const ::tensorflow::Scope & scope,\n const DataTypeSlice & component_types\n)\n``` \n\n### Barrier\n\n```gdscript\n Barrier(\n const ::tensorflow::Scope & scope,\n const DataTypeSlice & component_types,\n const Barrier::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Capacity\n\n```text\nAttrs Capacity(\n int64 x\n)\n``` \n\n### Container\n\n```text\nAttrs Container(\n StringPiece x\n)\n``` \n\n### Shapes\n\n```gdscript\nAttrs Shapes(\n const gtl::ArraySlice\u003c PartialTensorShape \u003e & x\n)\n``` \n\n### SharedName\n\n```text\nAttrs SharedName(\n StringPiece x\n)\n```"]]