tvm_ffi.InplaceMode

tvm_ffi.InplaceMode#

class tvm_ffi.InplaceMode(*values)#

Bases: IntEnum

Permission to mutate a value in place along its ownership path.

DISALLOW preserves the source through copy-on-write. ALLOW permits in-place mutation only when the current value is uniquely owned; it does not require a callback to reuse the value. Structural mutation callbacks receive the corresponding integer, which compares directly with these enum members.

See also

tvm_ffi.structural_mutate()

Mutate a value with callbacks that own recursive mutation.

DISALLOW = 0#
ALLOW = 1#