torch.long()

  • torch.long():向下取整
>>> b1 = torch.rand(3,3)
>>> b1
tensor([[0.7498, 0.2052, 0.9352],
        [0.1171, 0.2046, 0.1682],
        [0.3003, 0.7483, 0.0089]])
>>> b1.long()
tensor([[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]])

你可能感兴趣的:(pytorch,pytorch)