Transpose // Operation that transposes axes of a tensor
Description¶
Warning
This op is not yet implemented in any backend.
Warning
This op is experimental and subject to change without notice.
Operation that transposes axes of an input tensor. This operation covers matrix transposition, and also more general cases on higher-rank tensors.
Inputs¶
Name |
Element Type |
Shape |
---|---|---|
|
Any |
Any |
|
|
|
Outputs¶
Name |
Element Type |
Shape |
---|---|---|
|
Same as |
|
The input input_order
must be a vector of shape [n], where n is the
rank of arg
, and must contain every integer in the range [0,n-1]
. This
vector represents a permutation of arg
’s dimensions. For example,
|
|
|
Comment |
---|---|---|---|
|
|
|
Transposes the |
|
|
|
Transposes the |
|
|
|
Transposes the |
|
|
|
Moves the “last” dimension to the “first” position. |
Mathematical Definition¶
Backprop¶
Not yet implemented.
C++ Interface¶
-
class
Transpose
: public ngraph::op::Op¶ -
Tensor transpose operation.
Public Functions
-
const std::string &
description
() const¶ -
Get the string name for the type of the node, such as
Add
orMultiply
. The class name, must not contain spaces as it is used for codegen.- Return
-
A const reference to the node’s type name
-
Transpose
(const Output<Node> &arg, const Output<Node> &input_order)¶ -
Constructs a transpose operation.
- Parameters
-
arg
: Node producing the tensor to be transposed.input_order
: Node producing the permutation to apply to the axes of the input shape. Must be a vector of element type element::i64, with shape [n], where n is the rank of arg. The tensor’s value must contain every integer in the range [0,n-1].
-
void
validate_and_infer_types
()¶ -
Throws if the node is invalid.
-
const std::string &