1、torch numpy转换
#np to torch:
torch_data = torch.from_numpy(np_data)
#torch to np
tensor_data = torch_data.numpy()
1、torch numpy转换
#np to torch:
torch_data = torch.from_numpy(np_data)
#torch to np
tensor_data = torch_data.numpy()