AttributeError: module 'torch' has no attribute 'cmul'
I was trying to do element-wise multiplication of two tensors using the example provided here.

My code:

import torch

x = torch.Tensor([2, 3])
y = torch.Tensor([2, 1])
z = torch.cmul(x, y)
print(z)


It is giving me the following error.

AttributeError: module 'torch' has no attribute 'cmul'


Can anyone tell me why I am getting this error?

I got the solution. Instead of using cmul, I need to use mul. The following code worked for me!

import torch

x = torch.Tensor([2, 3])
y = torch.Tensor([2, 1])
z = torch.mul(x, y)
print(z)


PS: I was using pytorch, not lua.
