# tensorflow::ops::TensorArrayGradWithShape Class Reference

# tensorflow::
ops::
TensorArrayGradWithShape

`
#include <data_flow_ops.h>
`


Creates a
[TensorArray](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array)
for storing multiple gradients of values in the given handle.

## Summary


Similar to TensorArrayGradV3. However it creates an accumulator with an expanded shape compared to the input
[TensorArray](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array)
whose gradient is being computed. This enables multiple gradients for the same
[TensorArray](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array)
to be calculated using the same accumulator.


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- handle: The handle to the forward [TensorArray](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) .
- flow_in: A float scalar that enforces proper chaining of operations.
- shape_to_prepend: An int32 vector representing a shape. Elements in the gradient accumulator will have shape which is this shape_to_prepend value concatenated with shape of the elements in the [TensorArray](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) corresponding to the input handle.
- source: The gradient source string, used to decide which gradient [TensorArray](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) to return.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` grad_handle
- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` flow_out

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array-grad-with-shape#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1ae957f3234c62f254b88ced73dd452371 (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input handle, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input flow_in, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input shape_to_prepend, StringPiece source) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array-grad-with-shape#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1a7e66bafef678a0c4a661598e8d61c4a3 ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array-grad-with-shape#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1a732338604dc6b1ce0db860e97a5df6ec ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/tensor-array-grad-with-shape#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1a0430f64eabb7fa21eac6b06e3e01ec04 ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |

## Public attributes

### flow_out

```
::tensorflow::Output flow_out
```

### grad_handle

```
::tensorflow::Output grad_handle
```

### operation

```
Operation operation
```

## Public functions

### TensorArrayGradWithShape

```
 TensorArrayGradWithShape(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input handle,
  ::tensorflow::Input flow_in,
  ::tensorflow::Input shape_to_prepend,
  StringPiece source
)
```