If you have a numpy array and want to avoid a copy, use torch.as_tensor() . A tensor of specific data type can be constructed by passing a torch.dtype ...
確定! 回上一頁