torch.reshape()
ReshapingRearrange tensor elements into a new shape without changing data.
Reads elements in row-major order (left to right, top to bottom) and fills them into the new shape in the same order.
Python
Shift+Enter to run
1
2
3
4
5
6
7
8
Step 0 / 0
Speed
Write Python code and press Shift+Enter or click "Run" to visualize.
Run the operation to see step-by-step explanation.