FunctionRacerProblemsRace

Center the Columns

EasyPyTorchPython

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More PyTorch problems