torch.device_error_requires
export type device_error_requires<
Required extends string,
Actual extends string,
> = `DEVICE_ERROR: operation requires '${Required}' but tensor is on '${Actual}'`;Requiredextends stringActualextends stringDevice error for operations that require a specific device.
Examples
type Error = device_error_requires<'cpu', 'webgpu'>;
// = "DEVICE_ERROR: operation requires 'cpu' but tensor is on 'webgpu'"