Function tvm::tirx::MatchShapeStridePattern

Function tvm::tirx::MatchShapeStridePattern#

Function Documentation#

inline ffi::Optional<ffi::Tuple<ffi::Array<PrimExpr>, ffi::Array<PrimExpr>, PrimExpr>> tvm::tirx::MatchShapeStridePattern(const TensorType &tensor)#

Match a tensor’s shape-aligned strided memory representation.

Returns (shape, strides, element offset). An absent layout yields contiguous row-major strides and zero offset. A TileLayout must have one memory iterator per shape dimension, no replicas, and only a memory-axis offset. Other layouts or mismatched extents return nullopt. Strides are always actual expressions; an empty stride array means rank zero, not an implicit compact contract.

ExprDeepEqual preserves variable identity without remapping or symbolic proofs, avoiding the overhead and broader equivalences of general structural matching.