tvm_ffi.StructuralMutator#
- class tvm_ffi.StructuralMutator(*args, **kwargs)[source]#
Bases:
ObjectLow-level structural mutator.
This class exposes the mutator object used by structural-map and custom mutation hooks.
Methods
__init__(*args, **kwargs)__init_handle_by_constructor__(fconstructor, ...)Defined in
Objectas method__init_handle_by_constructor__().__move_handle_from__(other)Defined in
Objectas method__move_handle_from__()._move()Return the currently active structural def-region kind.
default_mutate(value)Mutate
valueusing its registered or reflected default behavior.is_(other)Defined in
Objectas methodis_().mutate(value)Mutate
valuewithout modifying it in place.same_as(other)var_remap_get(var)Return the replacement recorded for a variable identity.
var_remap_set(var, mapped_value)Record or replace the substitution for a variable identity.
with_def_region_kind(kind, callback)Run
callbackwith a temporarily active def-region kind.Attributes
id_Defined in
Objectas attributeid_.- mutate(value)[source]#
Mutate
valuewithout modifying it in place.The original value is returned when none of its structural fields change; otherwise, the result is a mutated copy.
- default_mutate(value)[source]#
Mutate
valueusing its registered or reflected default behavior.This bypasses the active engine callback for
valueitself while recursive children re-enter the same mutator. Astructural_mutatecallback may use it on its matched value to request default descent.
- var_remap_set(var, mapped_value)[source]#
Record or replace the substitution for a variable identity.
- def_region_kind()[source]#
Return the currently active structural def-region kind.
- Return type:
- Returns:
kind – The active
DefRegionKind.