MCPcopy
hub / github.com/TencentARC/Pixal3D / device

Method device

pixal3d/pipelines/base.py:53–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51
52 @property
53 def device(self) -> torch.device:
54 if hasattr(self, '_device'):
55 return self._device
56 for model in self.models.values():
57 if hasattr(model, 'device'):
58 return model.device
59 for model in self.models.values():
60 if hasattr(model, 'parameters'):
61 return next(model.parameters()).device
62 raise RuntimeError("No device found.")
63
64 def to(self, device: torch.device) -> None:
65 for model in self.models.values():

Callers 4

init_modelsFunction · 0.45
init_pipelineFunction · 0.45
cudaMethod · 0.45
cpuMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected