Flatten the tensor X into a 1-D tensor containing all of its elements in row-major order.
X
Input
tensor([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]])
Output
tensor([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.
solve(...)