Unit Rows
Scale each row of the 2-D tensor x so that its length becomes 1. The length of a row is the square root of the sum of the squares of its elements.
Example 1
x [[3.0,4.0],[0.0,2.0]]
returns [[0.6,0.8],[0.0,1.0]]
Constraints
- 1 to 5 rows, 1 to 4 columns
- No row is all zeros
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.