Skip to content
class

PhantomMode

PhantomMode

Thread-local switch for phantom tensors, modelled on GradMode.

Static methods

2
static

is_enabled

bool is_enabled()

Whether factories and ops on the calling thread make phantom tensors.

static

set_enabled

void set_enabled(bool value)

Sets the flag for the calling thread only. Prefer PhantomModeGuard, which restores the flag on unwind.