代码大致如下: a = torch.tensor(b) #b是bool类型 c = a.float() d = torch.tensor([0], dtype=torch.float32, device="