MLIR  20.0.0git
Functions
Traits.cpp File Reference
#include "mlir/Dialect/Traits.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/TypeUtilities.h"
#include "llvm/Support/FormatVariadic.h"
#include <optional>

Go to the source code of this file.

Functions

static ArrayRef< int64_t > getShape (Type type)
 Returns the shape of the given type. More...
 
template<typename iterator_range >
static std::tuple< bool, bool > hasTensorOrVectorType (iterator_range types)
 Returns a tuple corresponding to whether range has tensor or vector type. More...
 
static bool isCompatibleInferredReturnShape (ArrayRef< int64_t > inferred, ArrayRef< int64_t > existing)
 
static std::string getShapeString (ArrayRef< int64_t > shape)
 

Function Documentation

◆ getShape()

static ArrayRef<int64_t> getShape ( Type  type)
static

Returns the shape of the given type.

Scalars will be considered as having a shape with zero dimensions.

Definition at line 118 of file Traits.cpp.

Referenced by mlir::quant::QuantizedType::castFromStorageType(), and mlir::OpTrait::util::getBroadcastedType().

◆ getShapeString()

static std::string getShapeString ( ArrayRef< int64_t >  shape)
static

Definition at line 210 of file Traits.cpp.

◆ hasTensorOrVectorType()

template<typename iterator_range >
static std::tuple<bool, bool> hasTensorOrVectorType ( iterator_range  types)
static

Returns a tuple corresponding to whether range has tensor or vector type.

Definition at line 190 of file Traits.cpp.

◆ isCompatibleInferredReturnShape()

static bool isCompatibleInferredReturnShape ( ArrayRef< int64_t >  inferred,
ArrayRef< int64_t >  existing 
)
static

Definition at line 195 of file Traits.cpp.