colour.utilities.trace_array_namespace#
- class colour.utilities.trace_array_namespace[source]#
Bases:
objectDefine a context manager to trace
array_namespace()calls and array type flow through Colour functions usingsys.settrace().When active, every function call under
colour/is logged with the types of all array arguments (positional and keyword). Return values are logged with their types. Calls where multiple array backends coexist in the same argument list are flagged asMIXED.The trace output is indented to reflect the call stack depth.
Examples
>>> import torch >>> with array_api_enable(True), trace_array_namespace(): ... pass
- __exit__(*args: Any) None[source]#
Exit the context and restore the previous trace hook.
- Parameters:
args (Any)
- Return type:
None
- __weakref__#
list of weak references to the object