MCPcopy
hub / github.com/dmlc/dgl / _get_device

Function _get_device

python/dgl/dataloading/dataloader.py:781–785  ·  view source on GitHub ↗
(device)

Source from the content-addressed store, hash-verified

779
780
781def _get_device(device):
782 device = torch.device(device)
783 if device.type == "cuda" and device.index is None:
784 device = torch.device("cuda", torch.cuda.current_device())
785 return device
786
787
788class DataLoader(torch.utils.data.DataLoader):

Callers 1

__init__Method · 0.85

Calls 1

deviceMethod · 0.45

Tested by

no test coverage detected