11. Add a Zero Border

Easy

Add a border of zeros around the 2-D tensor Z: one extra row of zeros above and below, and one extra column of zeros to the left and right.

Input

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

Output

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

Sign in to write and run your own code.

Implement solve(...)