Hi! Thank you for respond
However y.expand(2, 1, 1, 1) gives me an error RuntimeError: The expanded size of the tensor (1) must match the existing size (2) at non-singleton dimension 3.  Target sizes: [2, 1, 1, 1].  Tensor sizes: [2]
I’ve made it the next way:
`
x = torch.ones((2, 3, 64, 64))
y = torch.ones((2))
x.view(2, -1) - y[:, None]
`
It works, but I’m not sure, it is the most optimal way