MLIR
20.0.0git
|
Range of values and shapes (corresponding effectively to Shapes dialect's ValueShape type concept). More...
#include "mlir/Interfaces/InferTypeOpInterface.h"
Public Types | |
using | ValueShapeMapFn = function_ref< ShapeAdaptor(Value)> |
using | type_iterator = ValueTypeIterator< iterator > |
Returns the types of the values within this range. More... | |
using | type_range = ValueTypeRange< ValueRange > |
Public Member Functions | |
ValueShapeRange (ValueRange values, ValueShapeMapFn operandShape=nullptr, ValueShapeMapFn valueToShape=nullptr) | |
ValueShapeRange (const std::initializer_list< Value > &values) | |
ValueShapeRange (const ValueShapeRange &)=default | |
ValueShapeRange & | setValueToShapeMapping (ValueShapeMapFn fn) |
Sets the Value to ShapeAdaptor mapping function and returns this. More... | |
ValueShapeRange & | setOperandShapeMapping (ValueShapeMapFn fn) |
ValueShapeMapFn | getValueToShapeMapping () const |
Returns the set Value to ShapeAdaptor mapping function. More... | |
ValueShapeMapFn | getOperandShapeMapping () const |
type_range | getTypes () const |
auto | getType () const |
ValueRange | getValues () const |
Returns the Values in the ValueRange. More... | |
ShapeAdaptor | getValueAsShape (int index) |
Returns an argument as shape. More... | |
ShapeAdaptor | getShape (int index) const |
Returns the shape of index'th operand. More... | |
ShapeAdaptor | getShape (Value val) const |
Returns the shape of the given Value. More... | |
Range of values and shapes (corresponding effectively to Shapes dialect's ValueShape type concept).
Definition at line 170 of file InferTypeOpInterface.h.
using mlir::ValueShapeRange::type_iterator = ValueTypeIterator<iterator> |
Returns the types of the values within this range.
Note: This returns only the types of Values in the ValueRange and not a more refined type.
Definition at line 203 of file InferTypeOpInterface.h.
Definition at line 204 of file InferTypeOpInterface.h.
Definition at line 172 of file InferTypeOpInterface.h.
|
inline |
Definition at line 174 of file InferTypeOpInterface.h.
|
inline |
Definition at line 178 of file InferTypeOpInterface.h.
|
default |
|
inline |
Definition at line 196 of file InferTypeOpInterface.h.
ShapeAdaptor ValueShapeRange::getShape | ( | int | index | ) | const |
Returns the shape of index'th operand.
Definition at line 213 of file InferTypeOpInterface.cpp.
Referenced by resolveBroadcastShape().
ShapeAdaptor ValueShapeRange::getShape | ( | Value | val | ) | const |
Returns the shape of the given Value.
Definition at line 206 of file InferTypeOpInterface.cpp.
References mlir::Value::getType().
|
inline |
Definition at line 206 of file InferTypeOpInterface.h.
References getTypes().
|
inline |
Definition at line 205 of file InferTypeOpInterface.h.
Referenced by getType().
ShapeAdaptor ValueShapeRange::getValueAsShape | ( | int | index | ) |
Returns an argument as shape.
If the argument is not constant or not a shape, then the function returns a nullptr. This will first query the valueToShape mapping (if set), before querying the ValueRange.
Definition at line 192 of file InferTypeOpInterface.cpp.
References mlir::m_Constant(), and mlir::matchPattern().
|
inline |
Returns the Values in the ValueRange.
To query the most up to date shape of a Value, query the shape using getShape below rather than using the type of the Value.
Definition at line 211 of file InferTypeOpInterface.h.
|
inline |
Returns the set Value to ShapeAdaptor mapping function.
Definition at line 195 of file InferTypeOpInterface.h.
|
inline |
Definition at line 189 of file InferTypeOpInterface.h.
|
inline |
Sets the Value to ShapeAdaptor mapping function and returns this.
Definition at line 184 of file InferTypeOpInterface.h.