Python common 模块,get_gpu_type() 实例源码

我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用common.get_gpu_type()

项目:pytorch-dist    作者:apaszke    | 项目源码 | 文件源码
def test_from_sequence(self):
        seq = [list(range(i*4,i*4+4)) for i in range(5)]
        reference = torch.range(0, 19).resize_(5, 4)
        for t in types:
            cuda_type = get_gpu_type(t)
            self.assertEqual(cuda_type(seq), reference)
项目:pytorch    作者:tylergenter    | 项目源码 | 文件源码
def test_from_sequence(self):
        seq = [list(range(i * 4, i * 4 + 4)) for i in range(5)]
        reference = torch.arange(0, 20).resize_(5, 4)
        for t in types:
            cuda_type = get_gpu_type(t)
            self.assertEqual(cuda_type(seq), reference)
项目:pytorch    作者:tylergenter    | 项目源码 | 文件源码
def test_is_tensor(self):
        for t in types:
            tensor = get_gpu_type(t)()
            self.assertTrue(torch.is_tensor(tensor))
        self.assertTrue(torch.is_tensor(torch.cuda.HalfTensor()))
项目:pytorch-coriander    作者:hughperkins    | 项目源码 | 文件源码
def test_from_sequence(self):
        seq = [list(range(i * 4, i * 4 + 4)) for i in range(5)]
        reference = torch.arange(0, 20).resize_(5, 4)
        for t in types:
            cuda_type = get_gpu_type(t)
            self.assertEqual(cuda_type(seq), reference)
项目:pytorch-coriander    作者:hughperkins    | 项目源码 | 文件源码
def test_is_tensor(self):
        for t in types:
            tensor = get_gpu_type(t)()
            self.assertTrue(torch.is_tensor(tensor))
        self.assertTrue(torch.is_tensor(torch.cuda.HalfTensor()))
项目:pytorch    作者:ezyang    | 项目源码 | 文件源码
def test_from_sequence(self):
        seq = [list(range(i * 4, i * 4 + 4)) for i in range(5)]
        reference = torch.arange(0, 20).resize_(5, 4)
        for t in types:
            cuda_type = get_gpu_type(t)
            self.assertEqual(cuda_type(seq), reference)
项目:pytorch    作者:ezyang    | 项目源码 | 文件源码
def test_is_tensor(self):
        for t in types:
            tensor = get_gpu_type(t)()
            self.assertTrue(torch.is_tensor(tensor))
        self.assertTrue(torch.is_tensor(torch.cuda.HalfTensor()))
项目:pytorch    作者:pytorch    | 项目源码 | 文件源码
def test_from_sequence(self):
        seq = [list(range(i * 4, i * 4 + 4)) for i in range(5)]
        reference = torch.arange(0, 20).resize_(5, 4)
        for t in types:
            cuda_type = get_gpu_type(t)
            self.assertEqual(cuda_type(seq), reference)
项目:pytorch    作者:pytorch    | 项目源码 | 文件源码
def test_is_tensor(self):
        for t in types:
            tensor = get_gpu_type(t)()
            self.assertTrue(torch.is_tensor(tensor))
        self.assertTrue(torch.is_tensor(torch.cuda.HalfTensor()))