warp.config.enable_array_function_overrides#
- warp.config.enable_array_function_overrides: bool = False#
Enable
__warp_function__overrides for supported Warp host APIs.This setting controls host Python APIs, such as
warp.launch()andwarp.copy(); it does not change@warp.funcdefinitions orwarp.Functionoverload resolution. The hook name follows PyTorch’s__torch_function__and NumPy’s__array_function__conventions.Enable this at startup, before saving or importing aliases of Warp APIs. This includes importing integrations that cache or wrap Warp functions. Applications that never enable it call the original functions directly, including array initialization, without forwarding wrappers or per-call flag checks. See Array Function Overrides for coverage and protocol details.
Changing this process-wide setting switches registered bindings in loaded Warp modules and the native array initializer. Aliases saved before activation keep their native outer entry points, which may still call wrapped helpers internally. Aliases saved while enabled retain their wrapper and honor subsequent flag changes. Change the setting only between tracing sessions, without concurrent calls.
Hooks can delegate directly: overrides are automatically suppressed in the current execution context while a hook or native implementation runs. Graph replay and saved launch-command execution bypass the protocol.
Note: Enabling this flag impacts performance even when no operand defines a hook.