tf.raw_ops.DataFormatVecPermute
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Permute input tensor from src_format
to dst_format
.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.raw_ops.DataFormatVecPermute
tf.raw_ops.DataFormatVecPermute(
x, src_format='NHWC', dst_format='NCHW', name=None
)
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 |
x
|
A Tensor . Must be one of the following types: int32 , int64 .
Tensor of rank 1 or 2 in source data format.
|
src_format
|
An optional string . Defaults to "NHWC" .
source data format.
|
dst_format
|
An optional string . Defaults to "NCHW" .
destination data format.
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor . Has the same type as x .
|
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 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.DataFormatVecPermute\n\n\u003cbr /\u003e\n\nPermute input tensor from `src_format` to `dst_format`.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.DataFormatVecPermute`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/DataFormatVecPermute)\n\n\u003cbr /\u003e\n\n tf.raw_ops.DataFormatVecPermute(\n x, src_format='NHWC', dst_format='NCHW', name=None\n )\n\nGiven source and destination format strings of length n=4 or 5, the input\ntensor must be a vector of size n or n-2, or a 2D tensor of shape\n(n, 2) or (n-2, 2).\n\nIf the first dimension of the input tensor is n-2, it is assumed that\nnon-spatial dimensions are omitted (i.e `N`, `C`).\n\nFor example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and input: \n\n [1, 2, 3, 4]\n\n, the output will be: \n\n [1, 4, 2, 3]\n\nWith `src_format` of `NDHWC`, `dst_format` of `NCDHW`, and input: \n\n [[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]\n\n, the output will be: \n\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 [1, 2]\n\n, the output will be: \n\n [1, 2]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------|----------------------------------------------------------------------------------------------------------------|\n| `x` | A `Tensor`. Must be one of the following types: `int32`, `int64`. Tensor of rank 1 or 2 in source data format. |\n| `src_format` | An optional `string`. Defaults to `\"NHWC\"`. source data format. |\n| `dst_format` | An optional `string`. Defaults to `\"NCHW\"`. destination data format. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor`. Has the same type as `x`. ||\n\n\u003cbr /\u003e"]]