Pytorch - Efficient Elementwise Multiply?
I have a tensor of 3D Points of [100x3]

I have a vector of weights of [100x1], which needs to be element wise multiplied into the X,Y,Z coordinates.

Currently, I am creating a new vector W where I stack the [100x3] element with repetition into a [100x3] tensor, before i do an element wise multiply.

I need to do this many times, and this is way too slow and memory intensive. Is there a better way?

Standard multiplication (*) in PyTorch already is elementwise. Additionally, it broadcasts. So

import torch
xyz = torch.randn(100, 3)
w = torch.randn(100, 1)
multiplied = xyz * w


will just do the trick.
