Unsqueeze - 1 vs 11#
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.
- Unsqueeze1 → Unsqueeze11 +7 -14
Unsqueeze1 → Unsqueeze11
RENAMED
@@ -1 +1 @@
|
|
1
|
-
Insert single-dimensional entries to the shape of
|
1
|
+
Insert single-dimensional entries to the shape of a tensor.
|
2
|
+
Takes one required argument axes, a list of dimensions that will be inserted.
|
3
|
+
Dimension indices in axes are as seen in the output tensor. For example:
|
2
|
-
Takes one required argument axes - which contains a list of dimension indices and this operator will insert a dimension of value 1 into the corresponding index of the output tensor (expanded).
|
3
|
-
|
4
|
-
For example:
|
5
|
-
Given
|
4
|
+
Given a tensor such that tensor with shape [3, 4, 5], then
|
5
|
+
Unsqueeze(tensor, axes=[0, 4]) has shape [1, 3, 4, 5, 1]
|
6
|
-
Unsqueeze(data, axes=[0, 4]) outputs a tensor (expanded) containing same data as data but with shape [1, 3, 4, 5, 1].
|
7
|
-
|
8
|
-
The attribute axes should not contain any duplicate entries. It is an error if it contains duplicates.
|
9
|
-
The rank of the output tensor (output_rank) is the rank of the input tensor (data) plus the number of values in axes.
|
10
|
-
Each value in axes should be within the (inclusive) range [-output_rank , output_rank - 1].
|
11
|
-
The order of values in axes does not matter and can come in any order.
|
12
6
|
**Attributes**
|
13
7
|
* **axes** (required):
|
8
|
+
List of non-negative integers, indicate the dimensions to be
|
9
|
+
inserted
|
14
|
-
List of integers indicating the dimensions to be inserted. Negative
|
15
|
-
value means counting dimensions from the back. Accepted range is
|
16
|
-
[-r, r-1] where r = rank(expanded).
|
17
10
|
**Inputs**
|
18
11
|
* **data** (heterogeneous) - **T**:
|
19
12
|
Original tensor
|
20
13
|
**Outputs**
|
21
14
|
* **expanded** (heterogeneous) - **T**:
|
22
15
|
Reshaped tensor with same data as input.
|
23
16
|
**Type Constraints**
|
24
17
|
* **T** in (
|
25
18
|
tensor(bool),
|
26
19
|
tensor(complex128),
|
27
20
|
tensor(complex64),
|
28
21
|
tensor(double),
|
29
22
|
tensor(float),
|
30
23
|
tensor(float16),
|
31
24
|
tensor(int16),
|
32
25
|
tensor(int32),
|
33
26
|
tensor(int64),
|
34
27
|
tensor(int8),
|
35
28
|
tensor(string),
|
36
29
|
tensor(uint16),
|
37
30
|
tensor(uint32),
|
38
31
|
tensor(uint64),
|
39
32
|
tensor(uint8)
|
40
33
|
):
|
41
34
|
Constrain input and output types to all tensor types.
|