def test_is_signed(self):
# TODO: remove the Variable wrapper once we merge Variable and Tensor
from torch.autograd import Variable
self.assertEqual(Variable(torch.IntTensor(5)).is_signed(), True)
self.assertEqual(Variable(torch.ByteTensor(5)).is_signed(), False)
self.assertEqual(Variable(torch.FloatTensor(5)).is_signed(), True)
self.assertEqual(Variable(torch.HalfTensor(10)).is_signed(), True)
评论列表
文章目录