classPhantomModePhantomModesourceeditThread-local switch for phantom tensors, modelled on GradMode.Static methods2staticis_enabledbool is_enabled()sourceeditWhether factories and ops on the calling thread make phantom tensors.staticset_enabledvoid set_enabled(bool value)sourceeditSets the flag for the calling thread only. Prefer PhantomModeGuard, which restores the flag on unwind.
staticis_enabledbool is_enabled()sourceeditWhether factories and ops on the calling thread make phantom tensors.
staticset_enabledvoid set_enabled(bool value)sourceeditSets the flag for the calling thread only. Prefer PhantomModeGuard, which restores the flag on unwind.