Skip to content
fn

active_dtype

int active_dtype(Device device)

Returns the active autocast dtype for device on the calling thread.

Reads the thread-local per-device AMP state established by the innermost live AutocastGuard for device. Returns std::nullopt when no guard is active for device.