DepthToSpace - 11 vs 13¶
DepthToSpace11 → DepthToSpace13
RENAMED
@@ -1 +1 @@
|
|
1
1
|
DepthToSpace rearranges (permutes) data from depth into blocks of spatial data.
|
2
2
|
This is the reverse transformation of SpaceToDepth. More specifically, this op outputs a copy of
|
3
3
|
the input tensor where values from the depth dimension are moved in spatial blocks to the height
|
4
4
|
and width dimensions. By default, mode = DCR.
|
5
5
|
In the DCR mode, elements along the depth dimension from the input tensor are rearranged in the
|
6
6
|
following order: depth, column, and then row. The output y is computed from the input x as below:
|
7
7
|
b, c, h, w = x.shape
|
8
8
|
tmp = np.reshape(x, [b, blocksize, blocksize, c // (blocksize**2), h, w])
|
9
9
|
tmp = np.transpose(tmp, [0, 3, 4, 1, 5, 2])
|
10
10
|
y = np.reshape(tmp, [b, c // (blocksize**2), h * blocksize, w * blocksize])
|
11
11
|
In the CRD mode, elements along the depth dimension from the input tensor are rearranged in the
|
12
12
|
following order: column, row, and the depth. The output y is computed from the input x as below:
|
13
13
|
b, c, h, w = x.shape
|
14
14
|
tmp = np.reshape(x, [b, c // (blocksize ** 2), blocksize, blocksize, h, w])
|
15
15
|
tmp = np.transpose(tmp, [0, 1, 4, 2, 5, 3])
|
16
16
|
y = np.reshape(tmp, [b, c // (blocksize ** 2), h * blocksize, w * blocksize])
|
17
17
|
**Attributes**
|
18
18
|
* **blocksize** (required):
|
19
19
|
Blocks of [blocksize, blocksize] are moved.
|
20
20
|
* **mode**:
|
21
21
|
DCR (default) for depth-column-row order re-arrangement. Use CRD for
|
22
22
|
column-row-depth order.
|
23
23
|
**Inputs**
|
24
24
|
* **input** (heterogeneous) - **T**:
|
25
25
|
Input tensor of [N,C,H,W], where N is the batch axis, C is the
|
26
26
|
channel or depth, H is the height and W is the width.
|
27
27
|
**Outputs**
|
28
28
|
* **output** (heterogeneous) - **T**:
|
29
29
|
Output tensor of [N, C/(blocksize * blocksize), H * blocksize, W *
|
30
30
|
blocksize].
|
31
31
|
**Type Constraints**
|
32
32
|
* **T** in (
|
33
|
+
tensor(bfloat16),
|
33
34
|
tensor(bool),
|
34
35
|
tensor(complex128),
|
35
36
|
tensor(complex64),
|
36
37
|
tensor(double),
|
37
38
|
tensor(float),
|
38
39
|
tensor(float16),
|
39
40
|
tensor(int16),
|
40
41
|
tensor(int32),
|
41
42
|
tensor(int64),
|
42
43
|
tensor(int8),
|
43
44
|
tensor(string),
|
44
45
|
tensor(uint16),
|
45
46
|
tensor(uint32),
|
46
47
|
tensor(uint64),
|
47
48
|
tensor(uint8)
|
48
49
|
):
|
49
50
|
Constrain input and output types to all tensor types.
|