Hi,
In numpy, we use x[:, None]. This is frequently used to elementwise matrix multiplication.
E.g.
x = np.array([1.8507 ,-2.7324])
y = np.array([0.9722 , 0.4470 , 1.0000 , 0.0000 , 0.0000 , 0.0000])

If we do, x * y, we will get the error:

ValueError: operands could not be broadcast together with shapes (2,) (6,)

But x * y[:,None], will give us
array([[ 1.79925054, -2.65643928],
       [ 0.8272629 , -1.2213828 ],
       [ 1.8507    , -2.7324    ],
       [ 0.        , -0.        ],
       [ 0.        , -0.        ],
       [ 0.        , -0.        ]])

Is there pytorch implementation of this kind of functionality?
Thank you!