|
MLIR 22.0.0git
|
Adaptor class to abstract the differences between whether value is from a ShapedType or ShapedTypeComponents or DenseIntElementsAttribute. More...
#include "mlir/Interfaces/InferTypeOpInterface.h"
Public Member Functions | |
| ShapeAdaptor (Type t) | |
| ShapeAdaptor (Attribute t) | |
| ShapeAdaptor (ShapedTypeComponents *components) | |
| ShapeAdaptor (ShapedTypeComponents &components) | |
| bool | hasRank () const |
| Returns whether the shape has a rank. | |
| Type | getElementType () const |
| Returns the element type. | |
| void | getDims (SmallVectorImpl< int64_t > &res) const |
| Populates the dimensions from shape referenced. | |
| void | getDims (ShapedTypeComponents &res) const |
| Populates the dimensions of the ShapeTypeComponents. | |
| int64_t | getDimSize (int index) const |
| Returns the size of the index'th dimension. | |
| bool | isDynamicDim (int index) const |
| Returns whether the index'th dimension is dynamic. | |
| bool | hasStaticShape () const |
| Returns whether the shape is fully static. | |
| int64_t | getRank () const |
| Returns the rank of the shape. | |
| int64_t | getNumElements () const |
| Returns the number of elements in the shape. | |
| operator bool () const | |
| Returns whether valid (non-null) shape. | |
| void | dump () const |
| Dumps textual repesentation to stderr. | |
Adaptor class to abstract the differences between whether value is from a ShapedType or ShapedTypeComponents or DenseIntElementsAttribute.
Definition at line 39 of file InferTypeOpInterface.h.
|
inline |
Definition at line 41 of file InferTypeOpInterface.h.
|
inline |
Definition at line 45 of file InferTypeOpInterface.h.
|
inline |
Definition at line 49 of file InferTypeOpInterface.h.
|
inline |
Definition at line 50 of file InferTypeOpInterface.h.
| void ShapeAdaptor::dump | ( | ) | const |
Dumps textual repesentation to stderr.
Definition at line 167 of file InferTypeOpInterface.cpp.
| void ShapeAdaptor::getDims | ( | ShapedTypeComponents & | res | ) | const |
Populates the dimensions of the ShapeTypeComponents.
Requires: shape is ranked.
Definition at line 98 of file InferTypeOpInterface.cpp.
| void ShapeAdaptor::getDims | ( | SmallVectorImpl< int64_t > & | res | ) | const |
Populates the dimensions from shape referenced.
Requires: shape is ranked.
Definition at line 81 of file InferTypeOpInterface.cpp.
References hasRank().
Referenced by dump(), getDims(), ReduceInferReturnTypes(), and mlir::ShapedTypeComponents::ShapedTypeComponents().
| int64_t ShapeAdaptor::getDimSize | ( | int | index | ) | const |
Returns the size of the index'th dimension.
Requires: shape is ranked.
Definition at line 104 of file InferTypeOpInterface.cpp.
References hasRank().
Referenced by isDynamicDim(), and poolingInferReturnTypes().
| Type ShapeAdaptor::getElementType | ( | ) | const |
Returns the element type.
Definition at line 71 of file InferTypeOpInterface.cpp.
Referenced by mlir::ShapedTypeComponents::ShapedTypeComponents().
| int64_t ShapeAdaptor::getNumElements | ( | ) | const |
Returns the number of elements in the shape.
Requires: hasStaticShape
Definition at line 142 of file InferTypeOpInterface.cpp.
References hasStaticShape().
Referenced by errorIfShapeNotSizeOne().
| int64_t ShapeAdaptor::getRank | ( | ) | const |
Returns the rank of the shape.
Requires: shape is ranked.
Definition at line 116 of file InferTypeOpInterface.cpp.
References hasRank().
Referenced by dump(), and ReduceInferReturnTypes().
| bool ShapeAdaptor::hasRank | ( | ) | const |
Returns whether the shape has a rank.
Definition at line 61 of file InferTypeOpInterface.cpp.
Referenced by dump(), errorIfShapeNotSizeOne(), getDims(), getDims(), getDimSize(), getRank(), hasStaticShape(), ReduceInferReturnTypes(), and mlir::ShapedTypeComponents::ShapedTypeComponents().
| bool ShapeAdaptor::hasStaticShape | ( | ) | const |
Returns whether the shape is fully static.
Definition at line 125 of file InferTypeOpInterface.cpp.
References hasRank().
Referenced by errorIfShapeNotSizeOne(), and getNumElements().
|
inline |
Returns whether the index'th dimension is dynamic.
Requires: shape is ranked.
Definition at line 72 of file InferTypeOpInterface.h.
References getDimSize().
|
inlineexplicit |
Returns whether valid (non-null) shape.
Definition at line 88 of file InferTypeOpInterface.h.