# tensorflow::ops::DataFormatVecPermute

`#include <nn_ops.h>`

Permute input tensor from `src_format` to `dst_format`.

## Summary

Given source and destination format strings of length n=4 or 5, the input tensor must be a vector of size n or n-2, or a 2D tensor of shape (n, 2) or (n-2, 2).

If the first dimension of the input tensor is n-2, it is assumed that non-spatial dimensions are omitted (i.e `N`, `C`).

For example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and input:

```
[1, 2, 3, 4]
```
, the output will be:

```
[1, 4, 2, 3]
```
With `src_format` of `NDHWC`, `dst_format` of `NCDHW`, and input:

```
[[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]
```
, the output will be:

```
[[1, 6], [5, 10], [2, 7], [3, 8], [4, 9]]
```
With `src_format` of `NHWC`, `dst_format` of `NCHW`, and input:

```
[1, 2]
```
, the output will be:

```
[1, 2]
```

<br />

Args:

- scope: A [Scope](https://www.tensorflow.org/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- x: [Tensor](https://www.tensorflow.org/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of rank 1 or 2 in source data format.

<br />

Optional attributes (see `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs`):

- src_format: source data format.
- dst_format: destination data format.

<br />

Returns:

- `https://www.tensorflow.org/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output`: [Tensor](https://www.tensorflow.org/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of rank 1 or 2 in destination data format.

<br />

| ### Constructors and Destructors ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a8babb4c1e126e473efe79cc7083f1f6d(const ::https://www.tensorflow.org/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input x)` ||
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a6d0e6d800f5d0411c873343c3ce89ba9(const ::https://www.tensorflow.org/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input x, const https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs & attrs)` ||

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1ac65cce7f5ddf5ef7efd6543c6f83c491` | `https://www.tensorflow.org/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation` |
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a47a3e96570db483721681a470526eacd` | `::https://www.tensorflow.org/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1ac6c53640d6b53b6bb728f92a7d426855() const ` | `::tensorflow::Node *` |
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a8c97823cde5e0028f42b19a28d8855d0() const ` |   |
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a19f5f9a816b2d7941524d4966f60c5a5() const ` |   |

| ### Public static functions ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1af8e8527150fac801f3e4db0686f97871(StringPiece x)` | `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs` |
| `https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a466d9b4a767bff538cc2de0b2c8992aa(StringPiece x)` | `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs` |

| ### Structs ||
|---|---|
| [tensorflow::ops::DataFormatVecPermute::Attrs](https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs) | Optional attribute setters for [DataFormatVecPermute](https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute). |

## Public attributes

### operation

```
Operation operation
```

### y

```
::tensorflow::Output y
```

## Public functions

### DataFormatVecPermute

```
 DataFormatVecPermute(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x
)
```

### DataFormatVecPermute

```
 DataFormatVecPermute(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x,
  const DataFormatVecPermute::Attrs & attrs
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```

## Public static functions

### DstFormat

```
Attrs DstFormat(
  StringPiece x
)
```

### SrcFormat

```
Attrs SrcFormat(
  StringPiece x
)
```