Two Rows
x is a 1-D tensor with an even number of elements. Return them as a table with 2 rows, in the same order: the first half in the first row, the second half in the second.
Example 1
x [1.0,2.0,3.0,4.0,5.0,6.0]
returns [[1.0,2.0,3.0],[4.0,5.0,6.0]]
Constraints
- 2 to 12 elements
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More PyTorch problems
- A Layer by HandEasy
- Center the ColumnsEasy
- Daily ReturnsEasy
- End to EndEasy
- Floor at ZeroEasy
- Matrix Times MatrixEasy
- One HotEasy
- Only the PositivesEasy