MCPcopy
hub / github.com/cornellius-gp/gpytorch / device

Method device

gpytorch/kernels/kernel.py:266–274  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

264
265 @property
266 def device(self) -> torch.device | None:
267 if self.has_lengthscale:
268 return self.lengthscale.device
269 devices = {param.device for param in self.parameters()}
270 if len(devices) > 1:
271 raise RuntimeError(f"The kernel's parameters are on multiple devices: {devices}.")
272 elif devices:
273 return devices.pop()
274 return None
275
276 @property
277 def dtype(self) -> torch.dtype:

Calls

no outgoing calls