torch.distributions.getDeviceFromTensors
function getDeviceFromTensors(tensors: Tensor[]): 'cpu' | 'webgpu'Get the device from a list of tensors. Returns 'webgpu' if any tensor is on GPU, otherwise 'cpu'.
Parameters
tensorsTensor[]
Returns
'cpu' | 'webgpu'