pytorch tensor整数除法 Posted on 2018-09-Tue Views: Views: 1234a = torch.Tensor([1, 3])b = torch.Tensor([1, 4])torch.sum(a == b) * 1.0 / 3 # ==> 0torch.sum(a == b).item() * 1.0 / 3