Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for convertToFloat (0.33 sec)

  1. tensorflow/compiler/mlir/lite/quantization/ir/ConvertSimQuant.cc

                                                       Type expressedType) const {
        return fakeQuantAttrsToType(
            fqOp.getLoc(), fqOp.getNumBits(), fqOp.getMin().convertToFloat(),
            fqOp.getMax().convertToFloat(), fqOp.getNarrowRange(), expressedType,
            fqOp.getIsSigned());
      }
    };
    
    class ConstFakeQuantPerAxisRewrite
        : public FakeQuantRewrite<ConstFakeQuantPerAxisRewrite,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 6K bytes
    - Viewed (0)
  2. 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)
  3. tensorflow/compiler/mlir/lite/stablehlo/transforms/compose_uniform_quantized_type_pass.cc

        const double input_inverse_scales_value =
            uniform_quantize_call_pattern_for_input.GetInverseScalesValueAttr()
                .getSplatValue<APFloat>()
                .convertToFloat();
        const double input_scale_value = 1.0 / input_inverse_scales_value;
        const int64_t input_zero_point_value =
            uniform_quantize_call_pattern_for_input.GetZeroPointsValueAttr()
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 64.6K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/utils/nms_utils.cc

      if (!float_attr) {
        return func.emitError()
               << attribute.c_str() << " attribute is not set or not a float";
      }
      builder->Float(attribute.c_str(), float_attr.getValue().convertToFloat());
      return success();
    }
    
    LogicalResult ConvertSSDPostProcessFunc::HasIntAttr(
        func::FuncOp func, DictionaryAttr attrs, const std::string& attribute) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. tensorflow/compiler/mlir/lite/flatbuffer_export.cc

        const llvm::APFloat value = index_and_value.value();
        if (index_and_value.index() % 2 == 0) {
          mins.push_back(value.convertToFloat());
        } else {
          maxs.push_back(value.convertToFloat());
        }
      }
    
      return tflite::CreateQuantizationParameters(
          builder_, builder_.CreateVector<float>(mins),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:41:49 UTC 2024
    - 164.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/ir/tfl_ops.cc

      Type result_type = getType();
      // Only constant fold for tensor of f32 is implemented.
      if (!IsF32ShapedType(result_type)) return nullptr;
    
      auto compute = [](APFloat value) -> APFloat {
        float f = value.convertToFloat();
        float result = std::sin(f);
        return APFloat(result);
      };
      return ConstFoldUnaryOp(result_type, operands[0], compute);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:41:17 UTC 2024
    - 169.2K bytes
    - Viewed (0)
Back to top