Shape - 21 vs 23¶
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.
- Shape21 → Shape23 +1 -1
Shape21 → Shape23
RENAMED
@@ -1 +1 @@
|
|
1
1
|
Takes a tensor as input and outputs an 1D int64 tensor containing the shape of the input tensor.
|
2
2
|
Optional attributes start and end can be used to compute a slice of the input tensor's shape.
|
3
3
|
If start axis is omitted, the slice starts from axis 0.
|
4
4
|
The end axis, if specified, is exclusive (and the returned value will not include the size of that axis).
|
5
5
|
If the end axis is omitted, the axes upto the last one will be included.
|
6
6
|
Negative axes indicate counting back from the last axis.
|
7
7
|
Note that axes will be clamped to the range [0, r-1], where r is the
|
8
8
|
rank of the input tensor if they are out-of-range (after adding r in the case of
|
9
9
|
negative axis). Thus, specifying any end value > r is equivalent to specifying an end
|
10
10
|
value of r, and specifying any start value < -r is equivalent to specifying a start
|
11
11
|
value of 0.
|
12
12
|
Examples:
|
13
13
|
Input tensor with shape: [2, 3, 4]
|
14
14
|
No attributes specified.
|
15
15
|
Output: [2, 3, 4]
|
16
16
|
Input tensor with shape: [2, 3, 4]
|
17
17
|
start: -1
|
18
18
|
Output: [4]
|
19
19
|
Input tensor with shape: [2, 3, 4]
|
20
20
|
end: -1
|
21
21
|
Output: [2, 3]
|
22
22
|
Input tensor with shape: [2, 3, 4]
|
23
23
|
start: 1
|
24
24
|
end: 2
|
25
25
|
Output: [3]
|
26
26
|
### Attributes
|
27
27
|
* **end - INT** :
|
28
28
|
(Optional) Ending axis for slicing the shape. Negative value means counting dimensions from the back. If omitted, sizes of all axes upto (including) the last one will be included.
|
29
29
|
* **start - INT** (default is '0'):
|
30
30
|
(Optional) Starting axis for slicing the shape. Default value is 0.Negative value means counting dimensions from the back.
|
31
31
|
### Inputs
|
32
32
|
- **data** (heterogeneous) - **T**:
|
33
33
|
An input tensor.
|
34
34
|
### Outputs
|
35
35
|
- **shape** (heterogeneous) - **T1**:
|
36
36
|
Shape of the input tensor
|
37
37
|
### Type Constraints
|
38
|
-
* **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) ):
|
38
|
+
* **T** in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(float4e2m1), 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) ):
|
39
39
|
Input tensor can be of arbitrary type.
|
40
40
|
* **T1** in ( tensor(int64) ):
|
41
41
|
Constrain output to int64 tensor.
|