Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-1209] Tutorial transpose reshape #13208

Merged
merged 14 commits into from
Dec 14, 2018
Prev Previous commit
Next Next commit
Update reshape_transpose.md
  • Loading branch information
NRauschmayr authored Nov 30, 2018
commit a6badc57c9b0296fc846b975c36706fa18949908
6 changes: 3 additions & 3 deletions docs/tutorials/basic/reshape_transpose.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ Assume ```x``` with the shape ```[batch_size, channel, upscale, width, height]`
To do so, we can use advanced reshaping, where we have to split the third dimension (upscale) and multiply it with width and height. We can do
```python
x = x.reshape(1, 3, -4, 2, 2, 0, 0)
print x.shape
print (x.shape)
```

(1L, 3L, 2L, 2L, 64L, 64L) <!--notebook-skip-line-->

This splits up the third dimension into ```[2,2]```, so (1L, 3L, **4L** , 64L, 64L) becomes (1L, 3L, **2L** , **2L** , 64L, 64L) The other dimensions remain unchanged. In order to multiply the new dimensions with width and height, we can do a transpose and then use reshape with -3.
```python
x = x.transpose((0, 1, 4, 2, 5, 3))
print x.shape
print (x.shape)
x = x.reshape(0, 0, -3, -3)
print x.shape
print (x.shape)
```

(1L, 3L, 64L, 2L, 64L, 2L) <!--notebook-skip-line-->
Expand Down