Premium problem46. Squeeze Singleton Dimensions

Easy Locked

Remove all size-1 dimensions from tensor x.

Input

tensor([[[[1.]],

         [[1.]],

         [[1.]],

         [[1.]],

         [[1.]],

         [[1.]],

         [[1.]],

         [[1.]],

         [[1.]]]])

Output

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

Premium problem

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

Implement solve(...)