- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for convertToFloat (0.16 sec)
-
tensorflow/compiler/mlir/lite/flatbuffer_operator.h
auto elemType = type.getElementType(); if (elemType.isF32()) { auto vec = llvm::to_vector(llvm::map_range( elements.getValues<APFloat>(), [&](APFloat value) -> float { return value.convertToFloat(); })); return std::vector<float>(vec.begin(), vec.end()); } return std::vector<float>(); } template <> inline std::vector<double> GetVector(DenseElementsAttr elements) {
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu May 16 21:00:09 UTC 2024 - 11.2K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/common/ir/UniformSupport.h
assert(&expressed_value.getSemantics() == &APFloat::IEEEsingle()); assert(storage_bit_width_ == 8); assert(round_mode_ == llvm::APFloatBase::rmNearestTiesToAway); const float real_value = expressed_value.convertToFloat(); const double scaled = real_value / scale_double_ + zero_point_double_; // Round to nearest integer with halfway cases rounded away from zero. const double scaled_rounded = std::round(scaled);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed May 08 02:10:16 UTC 2024 - 9.8K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/flatbuffer_operator.cc
floatVec.push_back( mlir::cast<mlir::FloatAttr>(attr).getValue().convertToFloat()); } return builder->CreateVector(floatVec); } // F32Attr already returns a float as required by flatbuffer builders. static float ConvertF32AttrForOptionWriter( llvm::APFloat f, flatbuffers::FlatBufferBuilder* builder) { return f.convertToFloat(); } // BoolAttr already returns a bool as required by flatbuffer builders.
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Tue May 21 18:21:50 UTC 2024 - 38K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver.cc
bias_quantized_type != nullptr) { double bias_half_range = 0.0f; for (auto bias : bias_values.getValues<APFloat>()) { if (bias_half_range < std::abs(bias.convertToFloat())) { bias_half_range = std::abs(bias.convertToFloat()); } } if (bias_half_range / bias_quantized_type.getScale() < kBiasMax) { return SetOperandParams(op, bias_index, params); }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 38.1K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/prepare_composite_functions_tf.cc
size_t start_map = fbb.StartMap(); for (auto attr : attrs) { if (auto float_attr = mlir::dyn_cast_or_null<FloatAttr>(attr.second)) { fbb.Float(attr.first.data(), float_attr.getValue().convertToFloat()); } else if (auto int_attr = mlir::dyn_cast_or_null<IntegerAttr>(attr.second)) { fbb.Int(attr.first.data(), int_attr.getInt());
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 17.6K bytes - Viewed (0) -
tensorflow/compiler/mlir/tfr/ir/tfr_ops.cc
} SmallVector<float> scale_factors; scale_factors.reserve(filter_scale_attr.size()); for (auto value : filter_scale_attr.getValues<APFloat>()) { scale_factors.push_back(in_scale * value.convertToFloat() / out_scale); } rewriter.setInsertionPoint(scale_factor_op); const Location loc = scale_factor_op->getLoc(); auto result_scale_op = rewriter.create<TF::ConstOp>(
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Tue Nov 21 16:55:41 UTC 2023 - 38.2K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.cc
std::transform(real_values_attr.begin(), real_values_attr.end(), std::back_inserter(real_values), [&](APFloat value) -> float { return value.convertToFloat(); }); const ShapedType new_dense_type = dyn_cast_or_null<ShapedType>( q_type.castExpressedToStorageType(real_values_attr.getType()));
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed May 08 02:10:16 UTC 2024 - 43.2K bytes - Viewed (0)