MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / set_device

Method set_device

monai/data/wsi_reader.py:129–133  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

127 self.dtype = np.dtype(dtype)
128
129 def set_device(self, device):
130 if device is None or isinstance(device, torch.device | str):
131 self.device = device
132 else:
133 raise ValueError(f"`device` must be `torch.device`, `str` or `None` but {type(device)} is given.")
134
135 @abstractmethod
136 def get_size(self, wsi, level: int) -> tuple[int, int]:

Callers 8

__init__Method · 0.95
_onnx_trt_compileFunction · 0.45
_set_cuda_deviceMethod · 0.45
test_dataMethod · 0.45
run_processMethod · 0.45
tearDownMethod · 0.45
test_valueMethod · 0.45
tearDownMethod · 0.45

Calls

no outgoing calls

Tested by 5

test_dataMethod · 0.36
run_processMethod · 0.36
tearDownMethod · 0.36
test_valueMethod · 0.36
tearDownMethod · 0.36