Halves
x holds whole numbers. Return half of each one, with its decimals: half of 3 is 1.5, not 1.
Example 1
x [3,4,-7]
returns [1.5,2.0,-3.5]
Constraints
- 1 to 8 elements
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More PyTorch problems
- The Last ColumnBeginner
- The ShapeBeginner
- Twice Plus OneBeginner
- Two RowsBeginner
- A Layer by HandEasy
- Center the ColumnsEasy
- Daily ReturnsEasy
- End to EndEasy