Premium problem42. Transpose a Matrix

Easy Locked

Return the transpose of the 2-D tensor X (swap its rows and columns).

Input

tensor([[0, 1, 2],
        [3, 4, 5]])

Output

tensor([[0, 3],
        [1, 4],
        [2, 5]])

Premium problem

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

Implement solve(...)