Home
last modified time | relevance | path

Searched refs:FloatAttr (Results 1 – 25 of 68) sorted by relevance

123

/external/tensorflow/tensorflow/compiler/mlir/lite/utils/
Dattribute_utils.cc22 FloatAttr ExtractSingleElementAsFloat(ElementsAttr attr) { in ExtractSingleElementAsFloat()
28 return attr.getValue<FloatAttr>(index); in ExtractSingleElementAsFloat()
31 FloatAttr GetSingleElementAsFloatOrSelf(Attribute attr) { in GetSingleElementAsFloatOrSelf()
35 return attr.dyn_cast_or_null<FloatAttr>(); in GetSingleElementAsFloatOrSelf()
Dattribute_utils.h35 FloatAttr ExtractSingleElementAsFloat(ElementsAttr attr);
40 FloatAttr GetSingleElementAsFloatOrSelf(Attribute attr);
Dconstant_utils.cc35 auto floatAttr = mlir::FloatAttr::get(floatType, static_cast<float>(value)); in CreateConstOpWithSingleValue()
40 auto floatAttr = mlir::FloatAttr::get(floatType, static_cast<float>(value)); in CreateConstOpWithSingleValue()
/external/llvm-project/mlir/test/Bindings/Python/
Dir_attributes.py113 fattr = FloatAttr(Attribute.parse("42.0 : f32"))
119 print("default_get:", FloatAttr.get(
122 print("f32_get:", FloatAttr.get_f32(42.0))
124 print("f64_get:", FloatAttr.get_f64(42.0))
126 fattr_invalid = FloatAttr.get(
Dir_array_attributes.py53 element = FloatAttr.get(t, 1.2)
67 element = FloatAttr.get(t, 1.2)
68 other_element = FloatAttr.get(other_t, 1.2)
/external/llvm-project/mlir/lib/IR/
DBuilders.cpp178 FloatAttr Builder::getF64FloatAttr(double value) { in getF64FloatAttr()
179 return FloatAttr::get(getF64Type(), APFloat(value)); in getF64FloatAttr()
182 FloatAttr Builder::getF32FloatAttr(float value) { in getF32FloatAttr()
183 return FloatAttr::get(getF32Type(), APFloat(value)); in getF32FloatAttr()
186 FloatAttr Builder::getF16FloatAttr(float value) { in getF16FloatAttr()
187 return FloatAttr::get(getF16Type(), value); in getF16FloatAttr()
190 FloatAttr Builder::getFloatAttr(Type type, double value) { in getFloatAttr()
191 return FloatAttr::get(type, value); in getFloatAttr()
194 FloatAttr Builder::getFloatAttr(Type type, const APFloat &value) { in getFloatAttr()
195 return FloatAttr::get(type, value); in getFloatAttr()
DBuiltinAttributes.cpp210 FloatAttr FloatAttr::get(Type type, double value) { in get()
214 FloatAttr FloatAttr::getChecked(Type type, double value, Location loc) { in getChecked()
218 FloatAttr FloatAttr::get(Type type, const APFloat &value) { in get()
222 FloatAttr FloatAttr::getChecked(Type type, const APFloat &value, Location loc) { in getChecked()
226 APFloat FloatAttr::getValue() const { return getImpl()->getValue(); } in getValue()
228 double FloatAttr::getValueAsDouble() const { in getValueAsDouble()
231 double FloatAttr::getValueAsDouble(APFloat value) { in getValueAsDouble()
247 LogicalResult FloatAttr::verifyConstructionInvariants(Location loc, Type type, in verifyConstructionInvariants()
252 LogicalResult FloatAttr::verifyConstructionInvariants(Location loc, Type type, in verifyConstructionInvariants()
690 return FloatAttr::get(eltTy, *floatIt); in operator *()
[all …]
/external/llvm-project/mlir/lib/Dialect/Quant/Utils/
DQuantizeUtils.cpp25 if (origRealValue.isa<FloatAttr>()) { in convertPrimitiveValueAttr()
26 FloatAttr floatAttr = origRealValue.cast<FloatAttr>(); in convertPrimitiveValueAttr()
/external/tensorflow/tensorflow/compiler/mlir/lite/quantization/
Ddevice_target.cc134 auto min = rop->getAttrOfType<FloatAttr>("min"); in DecomposeMultiplyAccumulateScale()
135 auto max = rop->getAttrOfType<FloatAttr>("max"); in DecomposeMultiplyAccumulateScale()
169 auto min = rop->getAttrOfType<FloatAttr>("min"); in DecomposeSameScale()
170 auto max = rop->getAttrOfType<FloatAttr>("max"); in DecomposeSameScale()
Dquantization_utils.h117 double rmin = FloatAttr::getValueAsDouble(*it++); in matchAndRewrite()
118 double rmax = FloatAttr::getValueAsDouble(*it); in matchAndRewrite()
135 double rmin = FloatAttr::getValueAsDouble(stats.getValue<APFloat>({0})); in matchAndRewrite()
136 double rmax = FloatAttr::getValueAsDouble(stats.getValue<APFloat>({1})); in matchAndRewrite()
345 FloatAttr tolerance = rewriter.getF32FloatAttr(error_tolerance); in matchAndRewrite()
Dquantization_utils.cc139 std::fabs(FloatAttr::getValueAsDouble(f))); in RescaleQuantizedType()
166 min_value.push_back(FloatAttr::getValueAsDouble(*it)); in GetQuantizedTypeAttr()
169 max_value.push_back(FloatAttr::getValueAsDouble(*it)); in GetQuantizedTypeAttr()
172 auto fmin = min.dyn_cast<FloatAttr>(); in GetQuantizedTypeAttr()
173 auto fmax = max.dyn_cast<FloatAttr>(); in GetQuantizedTypeAttr()
278 FloatAttr::getValueAsDouble(values.getSplatValue<llvm::APFloat>()); in ExtractMinMaxFromAttr()
300 double ele_value = FloatAttr::getValueAsDouble(*it); in ExtractMinMaxFromAttr()
/external/llvm-project/mlir/include/mlir/IR/
DBuilders.h34 class FloatAttr; variable
94 FloatAttr getFloatAttr(Type type, double value);
95 FloatAttr getFloatAttr(Type type, const APFloat &value);
109 FloatAttr getF16FloatAttr(float value);
110 FloatAttr getF32FloatAttr(float value);
111 FloatAttr getF64FloatAttr(double value);
/external/llvm-project/mlir/include/mlir/Bindings/Python/
DAttributes.td28 def : PythonAttr<"::mlir::FloatAttr", "_ir.FloatAttr">;
/external/tensorflow/tensorflow/compiler/mlir/hlo/lib/utils/
Dconvert_op_folder.cc42 mlir::FloatAttr::getValueAsDouble(floatVal)); in ConvertElementsAttr()
56 mlir::FloatAttr::getValueAsDouble(floatVal)); in ConvertElementsAttr()
/external/llvm-project/mlir/lib/Dialect/Tosa/Utils/
DQuantUtils.cpp302 min.push_back(FloatAttr::getValueAsDouble(i)); in buildQTypeFromMinMax()
304 max.push_back(FloatAttr::getValueAsDouble(i)); in buildQTypeFromMinMax()
306 auto minVal = minAttr.dyn_cast<FloatAttr>(); in buildQTypeFromMinMax()
311 auto maxVal = maxAttr.dyn_cast<FloatAttr>(); in buildQTypeFromMinMax()
/external/llvm-project/debuginfo-tests/llvm-prettyprinters/gdb/
Dmlir-support.cpp34 mlir::Attribute FloatAttr = mlir::FloatAttr::get(FloatType, 1.0); variable
Dmlir-support.gdb92 # CHECK: cast<mlir::FloatAttr>
93 p FloatAttr
/external/llvm-project/mlir/lib/Dialect/Quant/Transforms/
DConvertSimQuant.cpp113 min.push_back(m.cast<FloatAttr>().getValueAsDouble()); in convertFakeQuantAttrsToType()
115 max.push_back(m.cast<FloatAttr>().getValueAsDouble()); in convertFakeQuantAttrsToType()
DConvertConst.cpp71 if (!value.isa<FloatAttr, DenseElementsAttr, SparseElementsAttr>()) { in matchAndRewrite()
/external/llvm-project/mlir/test/mlir-tblgen/
Dop-attribute.td126 // DEF: if (!(((tblgen_f32_attr.isa<::mlir::FloatAttr>())) && ((tblgen_f32_attr.cast<::mlir::FloatA…
127 // DEF: if (!(((tblgen_f64_attr.isa<::mlir::FloatAttr>())) && ((tblgen_f64_attr.cast<::mlir::FloatA…
253 …lder, ::mlir::OperationState &odsState, ::mlir::FloatAttr attr, ::mlir::Value operand, ::mlir::Flo…
/external/llvm-project/mlir/unittests/IR/
DAttributeTest.cpp138 Attribute value = FloatAttr::get(floatTy, 10.0); in TEST()
146 Attribute value = FloatAttr::get(floatTy, 10.0); in TEST()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/
Ddecompose_resource_ops.cc32 FloatAttr attr = FloatAttr::get(float_ty, raw_value); in GetScalarOfType()
/external/llvm-project/mlir/lib/CAPI/IR/
DBuiltinAttributes.cpp98 return unwrap(attr).isa<FloatAttr>(); in mlirAttributeIsAFloat()
103 return wrap(FloatAttr::get(unwrap(type), value)); in mlirFloatAttrDoubleGet()
108 return wrap(FloatAttr::getChecked(unwrap(type), value, unwrap(loc))); in mlirFloatAttrDoubleGetChecked()
112 return unwrap(attr).cast<FloatAttr>().getValueAsDouble(); in mlirFloatAttrGetValueDouble()
/external/llvm-project/mlir/lib/Conversion/StandardToSPIRV/
DConvertStandardToSPIRV.cpp79 static FloatAttr convertFloatAttr(FloatAttr srcAttr, FloatType dstType, in convertFloatAttr()
83 return FloatAttr(); in convertFloatAttr()
94 return FloatAttr(); in convertFloatAttr()
630 FloatAttr dstAttr = convertFloatAttr( in matchAndRewrite()
631 srcAttr.cast<FloatAttr>(), dstElemType.cast<FloatType>(), rewriter); in matchAndRewrite()
683 auto srcAttr = constOp.value().cast<FloatAttr>(); in matchAndRewrite()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/utils/
Dexport_utils.cc102 Status ConvertAttribute(const mlir::FloatAttr& attr, AttrValue* value) { in ConvertAttribute()
189 } else if (auto attr = a.dyn_cast<mlir::FloatAttr>()) { in ConvertAttribute()
380 .Case<mlir::BoolAttr, mlir::IntegerAttr, mlir::FloatAttr, in ConvertAttributes()

123