Mojo struct
DynamicDim
A dynamic tensor dimension.
DynamicDim
s are printed in MO tensor types as ?
, eg.
!mo.tensor<[?, 4, ?], si32]>
has 2 dynamic dimensions.
Dynamic dimensions reduce the compiler's ability to reason about tensor shapes as data moves through the model, and may therefore limit the available optimizations it can perform. Reducing usage of dynamic dims can be an avenue to improving model performance.
Create a dynamic dimension via Dim.dynamic()
.
Implemented traits
AnyType
,
CollectionElement
,
Copyable
,
Movable
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
😔 What went wrong?