# tensorflow::ops::BarrierTakeMany Class Reference

# tensorflow::ops::BarrierTakeMany

`#include <data_flow_ops.h>`

Takes the given number of completed elements from a barrier.

## Summary

This operation concatenates completed-element component tensors along the 0th dimension to make a single component tensor.

Elements come out of the barrier when they are complete, and in the order in which they were placed into the barrier. The indices output provides information about the batch in which each element was originally inserted into the barrier.

Arguments:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- handle: The handle to a barrier.
- num_elements: A single-element tensor containing the number of elements to take.
- component_types: The type of each component in a value.

<br />

Optional attributes (see `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs`):

- allow_small_batch: Allow to return less than num_elements items if barrier is already closed.
- timeout_ms: If the queue is empty, this operation will block for up to timeout_ms milliseconds. Note: This option is not supported yet.

<br />

Returns:

- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` indices: A one-dimensional tensor of indices, with length num_elems. These indices refer to the batch in which the values were placed into the barrier (starting with MIN_LONG and increasing with each [BarrierInsertMany](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-insert-many#classtensorflow_1_1ops_1_1_barrier_insert_many)).
- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` keys: A one-dimensional tensor of keys, with length num_elements.
- `OutputList` values: One any-dimensional tensor per component in a barrier element. [All](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/all#classtensorflow_1_1ops_1_1_all) values have length num_elements in the 0th dimension.

<br />

| ### Constructors and Destructors ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1a7079c660a8be7b93534d6b9342549375(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input handle, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input num_elements, const DataTypeSlice & component_types)` ||
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1a0bbc5e5e2af22792ad5bd4a246591fc4(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input handle, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input num_elements, const DataTypeSlice & component_types, const https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs & attrs)` ||

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1a43e71cac399402222c6beab7c297d2ff` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1aac3b84f41d8da26a1b15f6c3f8294a34` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1ab7644c7503f6049a8eb1d9a50fa2217b` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1a55d011199c39e515002a93b15e1358a9` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c` |

| ### Public static functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1a58a8882a1c18ccb037a4e5876d16abde(bool x)` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1a31d75880ce856ac91e2eff9c8938ea12(int64 x)` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many_1a7e1cffc4f5b0b94d3892d02b7843e02d(bool x)` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs` |

| ### Structs ||
|---|---|
| [tensorflow::ops::BarrierTakeMany::Attrs](https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/barrier-take-many/attrs) | Optional attribute setters for [BarrierTakeMany](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many). |

## Public attributes

### indices

```
::tensorflow::Output indices
```

### keys

```
::tensorflow::Output keys
```

### operation

```
Operation operation
```

### values

```
::tensorflow::OutputList values
```

## Public functions

### BarrierTakeMany

```
 BarrierTakeMany(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input handle,
  ::tensorflow::Input num_elements,
  const DataTypeSlice & component_types
)
```

### BarrierTakeMany

```
 BarrierTakeMany(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input handle,
  ::tensorflow::Input num_elements,
  const DataTypeSlice & component_types,
  const BarrierTakeMany::Attrs & attrs
)
```

## Public static functions

### AllowSmallBatch

```
Attrs AllowSmallBatch(
  bool x
)
```

### TimeoutMs

```
Attrs TimeoutMs(
  int64 x
)
```

### WaitForIncomplete

```
Attrs WaitForIncomplete(
  bool x
)
```