PyTorch supports numpy’s broadcasting. Have a look at this explanation 87.
Numpy should show the same behavior:
a = np.random.randn(10, 3)
b = np.random.randn(10, 1)
c = a * b
print(c.shape)
>> (10, 3)