Premium problem26. Interleave 3 Zeros

Medium Locked

Given vector Z, build a new vector with 3 zeros interleaved between each value: [1,2,3] -> [1,0,0,0,2,0,0,0,3].

Input

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

Output

tensor([1, 0, 0,  ..., 0, 0, 5])

Premium problem

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

Implement solve(...)