It’s not clear to me what operation you are looking to perform. Can you explain a bit more, e.g., give the sizes of the 3d and 2d tensor, and what you mean by the * operator, is it matrix multiply or pointwise multiply?
Maybe you could use torch.matmul?