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).
Mojo trait
DenseTensor
Metadata trait: a Tensor backed by a dense (contiguous) layout.
Adds the layout type and preferred alignment on top of Tensor, giving the
kernel enough to build a TileTensor view over the argument's storage. The
dense-vs-plain distinction is invisible to the distilled contract.
Implemented traitsβ
comptime membersβ
alignmentβ
comptime alignment
dtypeβ
comptime dtype
LayoutTypeβ
comptime LayoutType
rankβ
comptime rank
ShapeTypeβ
comptime ShapeType
Required methodsβ
layoutβ
def layout(self) -> Self.LayoutType
Returns the tensor's layout (shape and strides).
Returns:
_Self.LayoutType: The argument's LayoutType instance.
shapeβ
def shape(self) -> Self.ShapeType
Returns the tensor's runtime shape.
Returns:
_Self.ShapeType: The shape as a Coord of the argument's ShapeType.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!