torch.empty(*size, *, out=None, dtype=None,
layout=torch.strided, device=None,
requires_grad=False, pin_memory=False,
memory_format=torch.contiguous_format) → Tensor
返回一个充满未初始化数据的张量。张量的形状由变量参数size定义。
a=torch.empty((2,3), dtype=torch.int32, device = 'cuda')
torch.empty_like(a)
tensor([[0, 0, 0], [0, 0, 0]], device='cuda:0', dtype=torch.int32)