IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

BufferValue

BufferValue​

class max.graph.BufferValue(value)

source

Bases: Value[BufferType]

Represents a mutable semantic tensor within a Graph.

Initializes a BufferValue from another value.

Parameters:

value (Value[Any] | _Value[mo.BufferType] | HasBufferValue) – The value to wrap, either an MLIR value of buffer type or another BufferValue.

device​

property device: DeviceRef

source

Returns the device of the BufferValue.

dtype​

property dtype: DType

source

Returns the tensor data type.

from_mlir()​

classmethod from_mlir(value)

source

Creates a BufferValue from an MLIR buffer value.

Parameters:

value (Value[BufferType]) – The MLIR buffer value to wrap.

Return type:

BufferValue

print()​

print(label='debug_buffer')

source

Prints detailed information about the buffer.

Parameters:

label (str)

Return type:

None

rank​

property rank: int

source

Returns the rank (number of dims) of the buffer.

shape​

property shape: Shape

source

Returns the shape of the BufferValue.

type​

property type: BufferType

source

Returns the type of the BufferValue as a BufferType.