Assign the data type to the Tensor elements: b = torch.tensor([[1.5, 2.3]], dtype=torch.int8) print(b) # tensor([[ 1, 2]], dtype=torch.int8).
確定! 回上一頁