tvm_tirx.script.ir_builder.parser_protocol.setitem_

Contents

tvm_tirx.script.ir_builder.parser_protocol.setitem_#

tvm_tirx.script.ir_builder.parser_protocol.setitem_(target, key, value, *, loc=None)#

Apply an indexed assignment using already-evaluated operands.

Parameters:
  • target (buffer Var) – Destination buffer.

  • key (Expr, int, slice or sequence) – Indices in written order; native buffer-store rules validate supported forms.

  • value (Expr or scalar) – Once-evaluated stored value.

  • loc (LocationEntry, Location or None, optional) – Location for the constructed result. None (the default) leaves explicit location unspecified; active source-call provenance is composed by the builder. Frames retain their location until finalization.

Returns:

AlreadyEmitted[Any] – Receipt retaining the exact emitted statement; consuming it emits nothing again.

Return type:

AlreadyEmitted[Any]

Notes

TIRx requires an active statement region and preserves target/index evaluation order. Native shape/type/index errors propagate. Relax raises TypeError because indexed mutation is unsupported.

# Source
A[i] = value
# Generated builder
X.setitem_(A, i, value)