MLIR 22.0.0git
TensorInferTypeOpInterfaceImpl.cpp File Reference

Go to the source code of this file.

Classes

struct  ReifyCollapseShapeOp

Functions

static OpFoldResult getCollapsedOutputDimFromInputShape (OpBuilder &builder, Location loc, int64_t dimIndex, Value src, ArrayRef< int64_t > dstStaticShape, ArrayRef< AffineMap > reassociationMap)
 For reshape op compute the shape at dimension dimIndex of the output in terms of shape of the src, when the reshape op is a collapsing operation.
static SmallVector< OpFoldResult, 4 > getCollapsedOutputShapeFromInputShape (OpBuilder &builder, Location loc, Value src, ArrayRef< int64_t > dstStaticShape, ArrayRef< AffineMap > reassociation)
 Given the src of a collapsing reshape op and its reassociation maps, compute the shape of the result of the reshape.

Function Documentation

◆ getCollapsedOutputDimFromInputShape()

OpFoldResult getCollapsedOutputDimFromInputShape ( OpBuilder & builder,
Location loc,
int64_t dimIndex,
Value src,
ArrayRef< int64_t > dstStaticShape,
ArrayRef< AffineMap > reassociationMap )
static

For reshape op compute the shape at dimension dimIndex of the output in terms of shape of the src, when the reshape op is a collapsing operation.

It is the product of the shape of the collapsed dimensions of the src.

Definition at line 22 of file TensorInferTypeOpInterfaceImpl.cpp.

References mlir::OpBuilder::createOrFold(), mlir::AffineMap::get(), mlir::Builder::getAffineSymbolExpr(), mlir::Builder::getIndexAttr(), mlir::AffineMap::getResults(), and mlir::affine::makeComposedAffineApply().

◆ getCollapsedOutputShapeFromInputShape()

SmallVector< OpFoldResult, 4 > getCollapsedOutputShapeFromInputShape ( OpBuilder & builder,
Location loc,
Value src,
ArrayRef< int64_t > dstStaticShape,
ArrayRef< AffineMap > reassociation )
static

Given the src of a collapsing reshape op and its reassociation maps, compute the shape of the result of the reshape.

Definition at line 50 of file TensorInferTypeOpInterfaceImpl.cpp.

Referenced by ReifyCollapseShapeOp::reifyResultShapes().