Center the Columns
Subtract from every element of the 2-D tensor x the mean of its column, and return the result. Every column then has mean 0.
Example 1
x [[1.0,10.0],[3.0,20.0]]
returns [[-1.0,-5.0],[1.0,5.0]]
Constraints
- 1 to 5 rows, 1 to 5 columns
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More PyTorch problems
- Daily ReturnsEasy
- End to EndEasy
- Floor at ZeroEasy
- Matrix Times MatrixEasy
- One HotEasy
- Only the PositivesEasy
- Rows That Sum to OneEasy
- Stack the RowsEasy