I have tensor a and b
a = torch.ones(3,2,2,2)
b = torch.Tensor([1,2,3])
I expect the result as:
tensor([[[[1., 1.],
          [1., 1.]],

         [[1., 1.],
          [1., 1.]]],


        [[[2., 2.],
          [2., 2.]],

         [[2., 2.],
          [2., 2.]]],


        [[[3., 3.],
          [3., 3.]],

         [[3., 3.],
          [3., 3.]]]])


Is there any easy way to do such computation?