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

Commit

Permalink
Update reshape_transpose.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NRauschmayr committed Nov 30, 2018
1 parent 07d46ce commit a6badc5
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit a6badc5

Please sign in to comment.