tvm_tirx.tirx.structural.structural_mutate_with_constraint_context#
- tvm_tirx.tirx.structural.structural_mutate_with_constraint_context(root, callback)#
Mutate a value with a callback that owns recursive mutation.
The callback receives
(value, mutator). It may callmutator.mutatefor selected children ormutator.default_mutatefor the matched value’s default mutation. Its returned value is final and is not traversed again.mutator.constraintscontains the active symbolic facts.- Parameters:
root (Any) – Root value to transform. A regular Python reference is preserved through copy-on-write.
callback (callable) – Called as
callback(value, mutator)with aStructuralMutatorWithConstraintContext. Return the mutated owning value.
- Returns:
result (Any) – The transformed root value.