Hi,

I can’t reproduce this error when running on colab.
Does the following code works for you?

import torch

s = torch.rand(8, 8, device="cuda")
x = torch.rand(8, 8, 89, device="cuda")

s = s.unsqueeze(2).expand(x.shape)

s * x


You can do this inplace by doing x *= s.