MCPcopy Create free account
hub / github.com/NVIDIA/MinkowskiEngine / test_device

Method test_device

tests/python/sparse_tensor.py:76–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74 print(input1.coordinate_map_key, input2.coordinate_map_key)
75
76 def test_device(self):
77 print(f"{self.__class__.__name__}: test_device SparseTensor")
78 if not is_cuda_available():
79 return
80
81 coords = torch.IntTensor(
82 [[0, 1], [0, 1], [0, 2], [0, 2], [1, 0], [1, 0], [1, 1]]
83 )
84 feats = torch.FloatTensor([[0, 1, 2, 3, 5, 6, 7]]).T
85
86 SparseTensor(feats.to(0), coords.to(0))
87 feats = torch.FloatTensor([[0, 1, 2, 3, 5, 6, 7]]).T.to(0)
88 st = SparseTensor(feats, coords, device=feats.device)
89 print(st)
90
91 def test_device_unique(self):
92 print(f"{self.__class__.__name__}: test_device_unique SparseTensor")

Callers

nothing calls this directly

Calls 2

SparseTensorClass · 0.90
is_cuda_availableFunction · 0.85

Tested by

no test coverage detected