Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
przepływ tensorowy:: ops:: Bariera
#include <data_flow_ops.h>
Definiuje barierę, która utrzymuje się w przypadku różnych wykonań wykresów.
Streszczenie
Bariera reprezentuje mapę klucz-wartość, w której każdy klucz jest ciągiem znaków, a każda wartość jest krotką tensorów.
W czasie wykonywania bariera zawiera elementy „kompletne” i „niekompletne”. Kompletny element ma zdefiniowane tensory dla wszystkich składników swojej krotki wartości i można uzyskać do niego dostęp za pomocą BarrierTakeMany . Niekompletny element ma w swojej krotce wartości niezdefiniowane komponenty i można go zaktualizować za pomocą BarrierInsertMany .
Argumenty:
- zakres: Obiekt Scope
- Component_types: Typ każdego komponentu w wartości.
Opcjonalne atrybuty (patrz Attrs
):
- kształty: kształt każdego składnika wartości. Każdy kształt musi mieć wartość 1 w pierwszym wymiarze. Długość tego atrybutu musi być taka sama jak długość komponentów_types.
- pojemność: Pojemność bariery. Domyślna pojemność to MAX_INT32 i jest to największa pojemność podstawowej kolejki.
- pojemnik: Jeśli nie jest pusty, barierę tę umieszcza się w danym pojemniku. W przeciwnym razie używany jest kontener domyślny.
- wspólna nazwa: Jeśli nie jest pusta, ta bariera będzie udostępniana pod podaną nazwą w wielu sesjach.
Zwroty:
Atrybuty publiczne
Funkcje publiczne
Bariera
Barrier(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
węzeł
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Wyjście
operator::tensorflow::Output() const
Publiczne funkcje statyczne
Pojemność
Attrs Capacity(
int64 x
)
Pojemnik
Attrs Container(
StringPiece x
)
Kształty
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
Wspólna nazwa
Attrs SharedName(
StringPiece x
)
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 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```"]]