torch.DeviceContext
export interface DeviceContext {
/** The device name */
readonly name: Device;
/** Whether the device is ready */
readonly ready: boolean;
/** Device-specific context (e.g., GPUDevice for WebGPU) */
readonly context: unknown;
/** Clean up device resources */
destroy(): void;
}- readonly
name(Device) - – The device name
- readonly
ready(boolean) - – Whether the device is ready
- readonly
context(unknown) - – Device-specific context (e.g., GPUDevice for WebGPU)
destroy(() => void)- – Clean up device resources
Device context returned from initialization.
This represents an initialized device ready for operations.