thunder.core.trace.TraceCtx¶
- class thunder.core.trace.TraceCtx(fn=None)[source]¶
Bases:
object
Trace representing
fn
.- fn[source]¶
Callable to represent. It’s either a callable written with pytorch functions or
Module
.- Type:
Callable | None
- args[source]¶
Arguments of
fn
. Elements are proxified, e.g.,torch.Tensor
is converted toTensorProxy
.- Type:
Any
- bound_symbols[source]¶
Each
BoundSymbol
represents one line of trace.- Type:
- scopes[source]¶
In most cases, same as
[self.bound_symbols]
. Direct modification of this attribute would provide better flexibility to trace transformation as ininsert_inplace()
andreplace_inplace()
. Also [tutorial] How to Implement CPU Offloading as Trace Transform would be a great read.- Type:
Methods
__init__
([fn])add_bound_symbol
(bsym)- rtype:
add_name
(name)- rtype:
add_object
(x)- rtype:
ContextObject
get_provenance
()- rtype:
Optional
[TraceProvenance
]
has_name
(name)- rtype:
is_constant
(x)- rtype:
make_name
([name, prefix])- rtype:
make_object_name
(x)- rtype:
mark_complete
()- rtype:
peek_scope
()pop_scope
()- rtype:
post_unpack
(fn)- rtype:
push_scope
(scope)- rtype:
python
(*[, print_depth, include_decorators])- rtype:
python_callable
(*[, global_dicts])- rtype:
python_ctx
()- rtype:
save_trace
(filename)- rtype:
set_current_source_location
(filename, positions)set_provenance
(provenance)- rtype:
siginfo
()- rtype:
unpacked
()- rtype:
unpacking
()- rtype:
Attributes
output
tags