5. Non-Zero Element Indices

Easy

Return the indices of the non-zero elements of the 1-D tensor a as a 1-D tensor.

Input

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

Output

tensor([0, 1, 4])
Implement solve(...)