TypeError: tensor(): argument ‘dtype‘ must be torch.dtype, not type

TypeError: tensor(): argument ‘dtype‘ must be torch.dtype, not type

TypeError: tensor(): argument ‘dtype‘ must be torch.dtype, not type

产生原因

tensor = torch.tensor([1,3,6], dtype=float32)# `datatype`

解决方案

tensor = torch.tensor([1,3,6], dtype=torch.float32)

以上就是全部内容

你可能感兴趣的:(pytorch,python,深度学习,机器学习)