FilesLast commitLast update
6 days ago
6 days ago
5 months ago
5 days ago
6 days ago
2 months ago
5 days ago
2 months ago
6 days ago
6 days ago
README

Reshape

English | 简体中文

Product Support Status

Product Supported
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products √
Atlas inference products √
Atlas training products √

Function Description

  • Operator function: reinterprets the input tensor to the target shape without changing the underlying data layout.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input tensor to be reshaped. BOOL, FLOAT16, FLOAT, INT4, INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, DOUBLE, COMPLEX64 ND, FRACTAL_NZ
shape Input Target shape tensor. One -1 is supported; when _allowzero is 0, 0 indicates copying the corresponding input dimension. INT32, INT64 1D
axis Attribute Starting replacement dimension. The default value is 0. INT -
num_axes Attribute Number of consecutive dimensions to be replaced. The default value is -1. INT -
y Output Output tensor after reshaping. Its data type is the same as that of input x. Same as x ND, FRACTAL_NZ

Constraint Description

  • The total number of output elements must be consistent with the total number of input elements.
  • At most one -1 can appear in shape.
  • When _allowzero is 0, 0 in shape copies the corresponding input dimension; when _allowzero is not set or is a non-zero value, 0 participates in the computation as a literal value.

Invocation Description

Invocation Method Sample Code Description
Graph-mode invocation test_geir_reshape Invokes the reshape operator by building a graph through the operator IR.