Premium problem23. Subtract Row Means

Medium Locked

Subtract the mean of each row from matrix X (keep dimensions). Return the result.

Input

tensor([[1., 2., 3.],
        [4., 6., 8.]])

Output

tensor([[-1.,  0.,  1.],
        [-2.,  0.,  2.]])

Premium problem

This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.

Implement solve(...)