Home
last modified time | relevance | path

Searched refs:QuantizedType (Results 1 – 25 of 35) sorted by relevance

12

/external/llvm-project/mlir/lib/Dialect/Quant/IR/
DQuantTypes.cpp23 unsigned QuantizedType::getFlags() const { in getFlags()
27 bool QuantizedType::classof(Type type) { in classof()
31 LogicalResult QuantizedType::verifyConstructionInvariants( in verifyConstructionInvariants()
62 Type QuantizedType::getStorageType() const { in getStorageType()
66 int64_t QuantizedType::getStorageTypeMin() const { in getStorageTypeMin()
70 int64_t QuantizedType::getStorageTypeMax() const { in getStorageTypeMax()
74 unsigned QuantizedType::getStorageTypeIntegralWidth() const { in getStorageTypeIntegralWidth()
80 Type QuantizedType::getExpressedType() const { in getExpressedType()
84 bool QuantizedType::isCompatibleExpressedType(Type candidateExpressedType) { in isCompatibleExpressedType()
92 QuantizedType
[all …]
DTypeParser.cpp54 storageTypeWidth > QuantizedType::MaxStorageBits) { in parseStorageType()
67 int64_t defaultIntegerMin = QuantizedType::getDefaultMinimumForInteger( in parseStorageRange()
69 int64_t defaultIntegerMax = QuantizedType::getDefaultMaximumForInteger( in parseStorageRange()
340 static void printStorageType(QuantizedType type, DialectAsmPrinter &out) { in printStorageType()
352 QuantizedType::getDefaultMinimumForInteger(isSigned, storageWidth); in printStorageType()
354 QuantizedType::getDefaultMaximumForInteger(isSigned, storageWidth); in printStorageType()
DQuantOps.cpp54 if (auto quantizedType = spec.dyn_cast<QuantizedType>()) in isValidQuantizationSpec()
/external/tensorflow/tensorflow/compiler/mlir/lite/quantization/
Dquantization.td26 // QuantizedType definitions.
30 class QuantizedType<string n, list<int> params, bit signed>
31 : Type<And<[CPred<"$_self.isa<mlir::quant::QuantizedType>()">,
32 CPred<"$_self.cast<mlir::quant::QuantizedType>()" #
44 : QuantizedType<"Uniform",
47 : QuantizedType<"Uniform",
52 def QUI8 : QuantizedType<"Uniform", [8], 0>;
53 def QI8 : QuantizedType<"Uniform", [8], 1>;
54 def QUI16 : QuantizedType<"Uniform", [16], 0>;
55 def QI16 : QuantizedType<"Uniform", [16], 1>;
[all …]
Dquantization_utils.cc94 quant::QuantizedType quantizedEleType; in GetQuantizedType()
127 auto ele_type = quant::QuantizedType::getQuantizedElementType(input); in RescaleQuantizedType()
147 quant::QuantizedType::castToExpressedType(input))) { in RescaleQuantizedType()
257 auto qtype = src_ele_type.dyn_cast<quant::QuantizedType>(); in CastQuantizedTypeAttrFromExpressedType()
376 quant::QuantizedType GetUniformQuantizedTypeForBias( in GetUniformQuantizedTypeForBias()
377 const std::vector<quant::QuantizedType>& op_types, in GetUniformQuantizedTypeForBias()
430 quant::QuantizedType::getDefaultMinimumForInteger(/*isSigned=*/true, 32); in GetUniformQuantizedTypeForBias()
432 quant::QuantizedType::getDefaultMaximumForInteger(/*isSigned=*/true, 32); in GetUniformQuantizedTypeForBias()
453 !quant::QuantizedType::getQuantizedElementType(tensor_type)) { in QuantizeLegacy()
457 auto q_type = quant::QuantizedType::getQuantizedElementType(tensor_type); in QuantizeLegacy()
[all …]
Dquantization_utils.h52 using QuantParams = quant::QuantizedType;
87 QuantizedType DownCastScale(QuantizedType type,
91 QuantizedType DownCastScale(QuantizedType type, double min, double max,
107 quant::QuantizedType quant_type; in matchAndRewrite()
384 using QType = quant::QuantizedType;
445 quant::QuantizedType::getQuantizedElementType(pre_quantized.getType()); in matchAndRewrite()
551 quant::QuantizedType GetUniformQuantizedTypeForBias(
552 const std::vector<quant::QuantizedType>& op_types,
Dquantization_traits.h25 using QuantizedType = mlir::quant::QuantizedType; variable
71 QuantizedType GetResultQuantizedType(int index) { in GetResultQuantizedType()
Ddevice_target.cc41 i8_min_ = QuantizedType::getDefaultMinimumForInteger(kSigned, k8Bits); in DeviceTarget()
42 i8_max_ = QuantizedType::getDefaultMaximumForInteger(kSigned, k8Bits); in DeviceTarget()
44 i32_min_ = QuantizedType::getDefaultMinimumForInteger(kSigned, k32Bits); in DeviceTarget()
45 i32_max_ = QuantizedType::getDefaultMaximumForInteger(kSigned, k32Bits); in DeviceTarget()
Dquantization_driver.cc48 static bool EmptyParams(QuantParams p) { return p == quant::QuantizedType(); } in EmptyParams()
256 quant::QuantizedType::getQuantizedElementType(in.getType()); in InitializeArgState()
412 quant::QuantizedType::getQuantizedElementType(val.getType()); in InitializeState()
454 if (auto quant_type = final_type.dyn_cast_or_null<quant::QuantizedType>()) { in SetConstantResultParams()
588 quant::QuantizedType::castToExpressedType(value.getType()); in RequantizeValue()
/external/llvm-project/mlir/include/mlir/Dialect/Quant/
DQuantTypes.h52 class QuantizedType : public Type {
139 static QuantizedType getQuantizedElementType(Type primitiveOrContainerType);
198 : public Type::TypeBase<AnyQuantizedType, QuantizedType,
255 : public Type::TypeBase<UniformQuantizedType, QuantizedType,
312 : public Type::TypeBase<UniformQuantizedPerAxisType, QuantizedType,
380 : public Type::TypeBase<CalibratedQuantizedType, QuantizedType,
DQuantizeUtils.h17 class QuantizedType; variable
36 Attribute quantizeAttr(Attribute realValue, QuantizedType quantizedElementType,
DQuantOpsBase.td33 // An implementation of QuantizedType.
35 Type<CPred<"$_self.isa<mlir::quant::QuantizedType>()">, "QuantizedType">;
/external/llvm-project/mlir/lib/Dialect/Quant/Utils/
DQuantizeUtils.cpp23 Attribute origRealValue, QuantizedType quantizedElementType, in convertPrimitiveValueAttr()
40 QuantizedType quantizedElementType, in convertDenseFPElementsAttr()
71 QuantizedType quantizedElementType, in convertSparseElementsAttr()
128 QuantizedType quantizedElementType, in quantizeAttr()
DUniformSupport.cpp35 Type ExpressedToQuantizedConverter::convert(QuantizedType elementalType) const { in convert()
/external/llvm-project/mlir/lib/Dialect/Quant/Transforms/
DConvertConst.cpp53 QuantizedType quantizedElementType = in matchAndRewrite()
54 QuantizedType::getQuantizedElementType(qbarrierResultType); in matchAndRewrite()
58 if (!QuantizedType::castToStorageType(qbarrierResultType)) { in matchAndRewrite()
DConvertSimQuant.cpp56 QuantizedType elementType = in failableRewrite()
88 QuantizedType convertFakeQuantAttrsToType(ConstFakeQuant fqOp, in convertFakeQuantAttrsToType()
107 QuantizedType convertFakeQuantAttrsToType(ConstFakeQuantPerAxis fqOp, in convertFakeQuantAttrsToType()
/external/tensorflow/tensorflow/compiler/mlir/lite/transforms/
Dload_quantization_recipe.cc79 int64_t int8_min = quant::QuantizedType::getDefaultMinimumForInteger( in Initialize()
81 int64_t int8_max = quant::QuantizedType::getDefaultMaximumForInteger( in Initialize()
83 int64_t int16_min = quant::QuantizedType::getDefaultMinimumForInteger( in Initialize()
85 int64_t int16_max = quant::QuantizedType::getDefaultMaximumForInteger( in Initialize()
Ddefault_quant_params.cc195 std::vector<quant::QuantizedType> non_bias_types; in GetQuantParamsForBias()
202 non_bias_type.getElementType().cast<quant::QuantizedType>(); in GetQuantParamsForBias()
/external/tensorflow/tensorflow/core/kernels/
Dmeta_support.cc175 template <typename QuantizedType>
177 const int bits = sizeof(QuantizedType) * 8; in CalculateRangeScale()
182 template <typename QuantizedType>
187 const int bits = sizeof(QuantizedType) * 8; in CalculateOneOverRangeScale()
/external/tensorflow/tensorflow/lite/kernels/
Dactivations_test.cc375 template <typename QuantizedType>
392 m.SetInput<QuantizedType>(float_input_values); in TestQuantizedHardSwish()
396 m.GetDequantizedOutput<QuantizedType>(); in TestQuantizedHardSwish()
407 template <typename QuantizedType>
412 static_cast<float>(std::numeric_limits<QuantizedType>::max()) - in TestQuantizedHardSwishBias()
413 static_cast<float>(std::numeric_limits<QuantizedType>::min()); in TestQuantizedHardSwishBias()
423 std::round(std::numeric_limits<QuantizedType>::min() + in TestQuantizedHardSwishBias()
426 std::round(std::numeric_limits<QuantizedType>::min() + in TestQuantizedHardSwishBias()
433 (i - std::numeric_limits<QuantizedType>::min()) * input_scale); in TestQuantizedHardSwishBias()
446 m.SetInput<QuantizedType>(float_input_values); in TestQuantizedHardSwishBias()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/lite/
Dflatbuffer_import.cc93 using mlir::quant::QuantizedType;
123 StatusOr<QuantizedType> GetQuantizedType(const TensorT& tensor, Builder builder, in GetQuantizedType()
150 int64_t storage_min = QuantizedType::getDefaultMinimumForInteger( in GetQuantizedType()
153 int64_t storage_max = QuantizedType::getDefaultMaximumForInteger( in GetQuantizedType()
181 StatusOr<QuantizedType> GetCalibratedQuantizedType(const TensorT& tensor, in GetCalibratedQuantizedType()
418 } else if (auto qtype = elem_type.dyn_cast<QuantizedType>()) { in ConvertIntBuffer()
486 if (auto qtype = element_ty.dyn_cast<QuantizedType>()) { in GetSplat()
541 } else if (elem_type.isa<mlir::IntegerType, QuantizedType>()) { in BuildConstOp()
880 mlir::quant::QuantizedType new_qtype; in PostProcessFuncOp()
/external/llvm-project/mlir/include/mlir/Dialect/Tosa/IR/
DTosaTypesBase.td27 : Type<And<[CPred<"$_self.isa<mlir::quant::QuantizedType>()">,
28 CPred<"$_self.cast<mlir::quant::QuantizedType>()" #
/external/llvm-project/mlir/lib/Dialect/Tosa/IR/
DTosaOps.cpp125 inputType.getElementType().template isa<mlir::quant::QuantizedType>(); in verifyConvOp()
127 weightType.getElementType().template isa<mlir::quant::QuantizedType>(); in verifyConvOp()
/external/llvm-project/mlir/lib/Dialect/Tosa/Utils/
DQuantUtils.cpp95 ((input_type).getElementType().dyn_cast<quant::QuantizedType>())
284 quant::QuantizedType retType; in buildQTypeFromMinMax()
/external/llvm-project/mlir/docs/
DQuantization.md177 between types based on a QuantizedType and its *expressed* and *storage*
201 * QuantizedType base class
206 * qcast : Convert from an expressed type to QuantizedType
207 * dcast : Convert from a QuantizedType to its expressed type
208 * scast : Convert between a QuantizedType and its storage type

12