., 2., 3., 4.])
>>> torch.arange(1., 10., 2)
tensor([1., 3., 5., 7., 9.])
>>> torch.linspace(0,1,11)...=1) # 可以指定维度
tensor([-0.4765, -0.1185])
>>> b
tensor([[3., 3., 3.],
[3., 3., 3.]])
>>> torch.std_mean..., 3., 3.],
[3., 3., 3.]])
b**2
tensor([[9., 9., 9.],
[9., 9., 9.]])...line 91, in runcode
exec(code, self.locals)
File "", line 1, in
RuntimeError: Expected...all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!