DepthToSpace - 1 vs 11

Files changed (1) hide show
  1. DepthToSpace1 → DepthToSpace11 +25 -1
DepthToSpace1 → DepthToSpace11 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
- and width dimensions.
4
+ and width dimensions. By default, mode = DCR.
5
+ In the DCR mode, elements along the depth dimension from the input tensor are rearranged in the
6
+ following order: depth, column, and then row. The output y is computed from the input x as below:
7
+
8
+ b, c, h, w = x.shape
9
+
10
+ tmp = np.reshape(x, [b, blocksize, blocksize, c // (blocksize**2), h, w])
11
+
12
+ tmp = np.transpose(tmp, [0, 3, 4, 1, 5, 2])
13
+
14
+ y = np.reshape(tmp, [b, c // (blocksize**2), h * blocksize, w * blocksize])
15
+
16
+ In the CRD mode, elements along the depth dimension from the input tensor are rearranged in the
17
+ following order: column, row, and the depth. The output y is computed from the input x as below:
18
+
19
+ b, c, h, w = x.shape
20
+
21
+ tmp = np.reshape(x, [b, c // (blocksize ** 2), blocksize, blocksize, h, w])
22
+
23
+ tmp = np.transpose(tmp, [0, 1, 4, 2, 5, 3])
24
+
25
+ y = np.reshape(tmp, [b, c // (blocksize ** 2), h * blocksize, w * blocksize])
5
26
  **Attributes**
6
27
  * **blocksize** (required):
7
28
  Blocks of [blocksize, blocksize] are moved.
29
+ * **mode**:
30
+ DCR (default) for depth-column-row order re-arrangement. Use CRD for
31
+ column-row-depth order.
8
32
  **Inputs**
9
33
  * **input** (heterogeneous) - **T**:
10
34
  Input tensor of [N,C,H,W], where N is the batch axis, C is the
11
35
  channel or depth, H is the height and W is the width.
12
36
  **Outputs**
13
37
  * **output** (heterogeneous) - **T**:
14
38
  Output tensor of [N, C/(blocksize * blocksize), H * blocksize, W *
15
39
  blocksize].
16
40
  **Type Constraints**
17
41
  * **T** in (
18
42
  tensor(bool),
19
43
  tensor(complex128),
20
44
  tensor(complex64),
21
45
  tensor(double),
22
46
  tensor(float),
23
47
  tensor(float16),
24
48
  tensor(int16),
25
49
  tensor(int32),
26
50
  tensor(int64),
27
51
  tensor(int8),
28
52
  tensor(string),
29
53
  tensor(uint16),
30
54
  tensor(uint32),
31
55
  tensor(uint64),
32
56
  tensor(uint8)
33
57
  ):
34
58
  Constrain input and output types to all tensor types.