Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::Barrier
#include <data_flow_ops.h>
Defines a barrier that persists across different graph executions.
Summary
A barrier represents a key-value map, where each key is a string, and each value is a tuple of tensors.
At 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. An incomplete element has some undefined components in its value tuple, and may be updated using BarrierInsertMany.
Args:
- scope: A Scope object
- component_types: The type of each component in a value.
Optional attributes (see Attrs
):
- 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.
- capacity: The capacity of the barrier. The default capacity is MAX_INT32, which is the largest capacity of the underlying queue.
- container: If non-empty, this barrier is placed in the given container. Otherwise, a default container is used.
- shared_name: If non-empty, this barrier will be shared under the given name across multiple sessions.
Returns:
Output
: The handle to the barrier.
Public attributes
Public functions
Barrier
Barrier(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
Capacity
Attrs Capacity(
int64 x
)
Container
Attrs Container(
StringPiece x
)
Shapes
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
SharedName
Attrs SharedName(
StringPiece x
)
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 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 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.14/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.14/api_docs/cc/class/tensorflow/ops/barrier-insert-many#classtensorflow_1_1ops_1_1_barrier_insert_many).\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/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.14/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.14/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.14/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.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, const DataTypeSlice & component_types, const `[Barrier::Attrs](/versions/r2.14/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.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_barrier_1a66ea0f34005305664b3a8c2b7237c73b) | [Operation](/versions/r2.14/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.14/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.14/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.14/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.14/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.14/api_docs/cc/struct/tensorflow/ops/barrier/attrs) | Optional attribute setters for [Barrier](/versions/r2.14/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```"]]