Skip to main content

Module layout

Module layout 

Source
Expand description

Memory layout optimization pass.

Assigns optimal memory layouts to tensor global variables based on the target backend’s preferred format, and tracks where layout conversions would be needed.

Structs§

LayoutTransform
Assigns a target memory layout to all tensor-typed global variables that do not already have a layout annotation.
TransposeInsertion
Pass that detects layout mismatches at graph boundaries and records the transposes needed to convert between layouts.
TransposeRecord
Information about a needed transpose at a graph boundary.

Functions§

count_layout_mismatches
Counts the number of layout mismatches between global variables.
layout_permutation
Returns the permutation needed to convert from one layout to another.
preferred_layout_for_target
Returns the preferred memory layout for a given backend target name.
reorder_dims
Reorder 4-D shape dimensions from one layout to another.