thunder.core.transforms.replace_inplace¶
- thunder.core.transforms.replace_inplace(trc, idx, fn)[source]¶
Removes
idx
-thBoundSymbol
oftrc
and replace itbsyms
representingfn
.- Parameters:
trc¶ (
TraceCtx
) – Trace to insertBoundSymbol
s representingfn
.idx¶ (
int
) – Index ofBoundSymbol
oftrc
.fn¶ (
Callable
[[BoundSymbol
],Any
]) – Callable to bake intotrc
, instead ofidx
-thBoundSymbol
.trc (TraceCtx) –
idx (int) –
fn (Callable[[BoundSymbol], Any]) –
- Return type:
Note
This operation is inplace. It will modify the given
trc
’sbound_symbols
.Note
Because this operation is explicitly inplace, it will disregard whether or not
mark_complete()
has been called ontrc
already.