Reshape - 5 vs 21¶
Next section compares an older to a newer version of the same operator after both definition are converted into markdown text. Green means an addition to the newer version, red means a deletion. Anything else is unchanged.
- Reshape5 → Reshape21 +14 -2
Reshape5 → Reshape21
RENAMED
@@ -1 +1 @@
|
|
1
1
|
Reshape the input tensor similar to numpy.reshape.
|
2
2
|
First input is the data tensor, second input is a shape tensor which specifies the output shape. It outputs the reshaped tensor.
|
3
3
|
At most one dimension of the new shape can be -1. In this case, the value is
|
4
4
|
inferred from the size of the tensor and the remaining dimensions. A dimension
|
5
5
|
could also be 0, in which case the actual dimension value is unchanged (i.e. taken
|
6
|
+
from the input tensor). If 'allowzero' is set, and the new shape includes 0, the
|
7
|
+
dimension will be set explicitly to zero (i.e. not taken from input tensor).
|
6
|
-
|
8
|
+
Shape (second input) could be an empty shape, which means converting to a scalar.
|
7
9
|
The input tensor's shape and the output tensor's shape are required to have the same number of elements.
|
10
|
+
|
11
|
+
If the attribute 'allowzero' is set, it is invalid for the specified shape to
|
12
|
+
contain both a zero value and -1, as the value of the dimension corresponding
|
13
|
+
to -1 cannot be determined uniquely.
|
14
|
+
|
15
|
+
### Attributes
|
16
|
+
|
17
|
+
* **allowzero - INT** (default is '0'):
|
18
|
+
|
19
|
+
(Optional) By default, when any value in the 'shape' input is equal to zero the corresponding dimension value is copied from the input tensor dynamically. allowzero=1 indicates that if any value in the 'shape' input is set to zero, the zero value is honored, similar to NumPy.
|
8
20
|
### Inputs
|
9
21
|
- **data** (heterogeneous) - **T**:
|
10
22
|
An input tensor.
|
11
23
|
- **shape** (heterogeneous) - **tensor(int64)**:
|
12
24
|
Specified shape for output.
|
13
25
|
### Outputs
|
14
26
|
- **reshaped** (heterogeneous) - **T**:
|
15
27
|
Reshaped data.
|
16
28
|
### Type Constraints
|
17
|
-
* **T** in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ):
|
29
|
+
* **T** in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) ):
|
18
30
|
Constrain input and output types to all tensor types.
|