コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦::バリア
#include <data_flow_ops.h>
異なるグラフ実行にわたって持続するバリアを定義します。
まとめ
バリアはキーと値のマップを表します。ここで、各キーは文字列であり、各値はテンソルのタプルです。
実行時には、バリアには「完全」要素と「不完全」要素が含まれます。完全な要素には、その値タプルのすべてのコンポーネントのテンソルが定義されており、 BarrierTakeManyを使用してアクセスできます。不完全な要素の値タプルには未定義のコンポーネントがいくつかあり、 BarrierInsertManyを使用して更新される可能性があります。
引数:
- スコープ:スコープオブジェクト
- Component_types: 値内の各コンポーネントのタイプ。
オプションの属性 ( Attrs
を参照):
- 形状: 値の各コンポーネントの形状。各形状の最初の次元は 1 でなければなりません。この属性の長さは、component_types の長さと同じである必要があります。
- 容量: バリアの容量。デフォルトの容量は MAX_INT32 で、これは基礎となるキューの最大容量です。
- コンテナ: 空でない場合、このバリアは指定されたコンテナに配置されます。それ以外の場合は、デフォルトのコンテナが使用されます。
- shared_name: 空でない場合、このバリアは指定された名前で複数のセッション間で共有されます。
戻り値:
パブリック属性
公共機能
バリア
Barrier(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
パブリック静的関数
容量
Attrs Capacity(
int64 x
)
容器
Attrs Container(
StringPiece x
)
形状
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
共有名
Attrs SharedName(
StringPiece x
)
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 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/r1.15/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/r1.15/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/r1.15/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/r1.15/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/r1.15/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/r1.15/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/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, const DataTypeSlice & component_types, const `[Barrier::Attrs](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_barrier_1a66ea0f34005305664b3a8c2b7237c73b) | [Operation](/versions/r1.15/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/r1.15/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/r1.15/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/r1.15/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/r1.15/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/r1.15/api_docs/cc/struct/tensorflow/ops/barrier/attrs) | Optional attribute setters for [Barrier](/versions/r1.15/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```"]]