Stay organized with collections
Save and categorize content based on your preferences.
#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]
Args:
- scope: A Scope object
- x: Tensor of rank 1 or 2 in source data format.
Optional attributes (see Attrs
):
- src_format: source data format.
- dst_format: destination data format.
Returns:
Public attributes
Public functions
Public static functions
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::DataFormatVecPermute Class Reference\n\ntensorflow::ops::DataFormatVecPermute\n=====================================\n\n`#include \u003cnn_ops.h\u003e`\n\nPermute input tensor from `src_format` to `dst_format`.\n\nSummary\n-------\n\nGiven 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).\n\nIf the first dimension of the input tensor is n-2, it is assumed that non-spatial dimensions are omitted (i.e `N`, `C`).\n\nFor example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and input: \n\n```text\n[1, 2, 3, 4]\n```\n, the output will be: \n\n```text\n[1, 4, 2, 3]\n```\nWith `src_format` of `NDHWC`, `dst_format` of `NCDHW`, and input: \n\n```text\n[[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]\n```\n, the output will be: \n\n```text\n[[1, 6], [5, 10], [2, 7], [3, 8], [4, 9]]\n```\nWith `src_format` of `NHWC`, `dst_format` of `NCHW`, and input: \n\n```text\n[1, 2]\n```\n, the output will be: \n\n```text\n[1, 2]\n```\n\n\u003cbr /\u003e\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- x: [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of rank 1 or 2 in source data format.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs)):\n\n- src_format: source data format.\n- dst_format: destination data format.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): [Tensor](/versions/r2.14/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of rank 1 or 2 in destination data format.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [DataFormatVecPermute](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a8babb4c1e126e473efe79cc7083f1f6d)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x)` ||\n| [DataFormatVecPermute](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a6d0e6d800f5d0411c873343c3ce89ba9)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x, const `[DataFormatVecPermute::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1ac65cce7f5ddf5ef7efd6543c6f83c491) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [y](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a47a3e96570db483721681a470526eacd) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1ac6c53640d6b53b6bb728f92a7d426855)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a8c97823cde5e0028f42b19a28d8855d0)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a19f5f9a816b2d7941524d4966f60c5a5)`() const ` | |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DstFormat](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1af8e8527150fac801f3e4db0686f97871)`(StringPiece x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs) |\n| [SrcFormat](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a466d9b4a767bff538cc2de0b2c8992aa)`(StringPiece x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::DataFormatVecPermute::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/data-format-vec-permute/attrs) | Optional attribute setters for [DataFormatVecPermute](/versions/r2.14/api_docs/cc/class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### y\n\n```text\n::tensorflow::Output y\n``` \n\nPublic functions\n----------------\n\n### DataFormatVecPermute\n\n```gdscript\n DataFormatVecPermute(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x\n)\n``` \n\n### DataFormatVecPermute\n\n```gdscript\n DataFormatVecPermute(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x,\n const DataFormatVecPermute::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### DstFormat\n\n```text\nAttrs DstFormat(\n StringPiece x\n)\n``` \n\n### SrcFormat\n\n```text\nAttrs SrcFormat(\n StringPiece x\n)\n```"]]