ptrblck:

b = torch.ones(3, 5, 5, 5) c = torch.tensor([0., 1., 2.]) d = b * c.view(-1, 1, 1, 1)


Hi @ptrblck,
Thank for the quick response! Much appreciated!
Part of the reason why I’ve gone about this in such a confusing way is because I won’t know the dim of the initial tensor a. That’s where I run into troubles using view.