I was doing some tests with pytorch tensor and something just came to my attention. Here are the steps to reproduce:

Create a pytorch tensor (either on cpu or gpu);
Create a numpy array;
Sum the pytorch tensor with the numpy array (this fails);
Sum the numpy array with the pytorch tensor (this works and return a cpu tensor);

So, is this behavior expected? I could not find any documentation or topic on that.
Example code follows:
>>> a = torch.tensor((10,10), device='cuda')
>>> a
tensor([10, 10], device='cuda:0')
>>> c = np.array((10,10))
>>> c
array([10, 10])
>>> a + c
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: add() received an invalid combination of arguments - got (numpy.ndarray), but expected one of:
 * (Tensor other, Number alpha)
 * (Number other, Number alpha)

>>> c + a
tensor([20, 20])
>>> b = torch.tensor((10,10))
>>> b
tensor([10, 10])
>>> b + c
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: add() received an invalid combination of arguments - got (numpy.ndarray), but expected one of:
 * (Tensor other, Number alpha)
 * (Number other, Number alpha)

>>> c + b
tensor([20, 20])
>>>