Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 34 for FloatAttr (0.17 sec)

  1. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

          stats_op.emitError("Stats should have 2 values.");
          return failure();
        }
        quant::QuantizedType quant_type;
        double min = FloatAttr::getValueAsDouble(stats.getValues<APFloat>()[0]);
        double max = FloatAttr::getValueAsDouble(stats.getValues<APFloat>()[1]);
        // Make sure the range includes zero.
        min = std::min(min, 0.0);
        max = std::max(max, 0.0);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/stablehlo/transforms/fold_broadcast_pass.cc

        auto bcast_dims = bcast_op.getBroadcastDimensions();
        auto elem_type = const_val.getElementType();
        Attribute result;
        if (mlir::isa<FloatType>(elem_type)) {
          result = ConstFoldBroadcastInDim<FloatAttr>(result_type, const_val,
                                                      bcast_dims);
        } else if (mlir::isa<IntegerType>(elem_type)) {
          result = ConstFoldBroadcastInDim<IntegerAttr>(result_type, const_val,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/translate/tf_mlir_translate.cc

                rand_val = mlir::IntegerAttr::get(element_type, std::rand());
              } else if (element_type.isF16() || element_type.isF32() ||
                         element_type.isF64()) {
                rand_val = mlir::FloatAttr::get(element_type,
                                                std::rand() * 1.0 / RAND_MAX);
    
              } else {
                inst.emitWarning()
                    << "Skipping splat conversion for "
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 07 11:51:44 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

        return {};
      }
      std::vector<double> multiplier_values;
      absl::c_transform(multiplier_attr, std::back_inserter(multiplier_values),
                        [](auto v) { return FloatAttr::getValueAsDouble(v); });
      ArrayRef<double> multiplier_array(multiplier_values.data(),
                                        multiplier_values.size());
    
      // Multiply the quantization parameters by the multiplier.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tfr/passes/decompose.cc

    namespace {
    
    // Quantize the float value based on given scale and zero point attributes.
    IntegerAttr Quantize(float value, Attribute scale_attr, Attribute zp_attr,
                         OpBuilder builder) {
      double scale = mlir::cast<FloatAttr>(scale_attr).getValueAsDouble();
      int64_t zp = mlir::cast<IntegerAttr>(zp_attr).getInt();
    
      int quantized = static_cast<int>(std::round(value / scale) + zp);
      quantized =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/transforms/prepare_composite_functions_tf.cc

      // reading custom option from dictionary rather than depending on the order.
      flexbuffers::Builder fbb;
      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)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/ir/tfl_ops.cc

                                       delta_attr);
        } else if (elem_type.isa<FloatType>()) {
          auto start_attr = start_tensor.getValues<FloatAttr>()[0];
          auto limit_attr = limit_tensor.getValues<FloatAttr>()[0];
          auto delta_attr = delta_tensor.getValues<FloatAttr>()[0];
          const int num_elements = GetLengthOfRange(start_attr.getValueAsDouble(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:41:17 UTC 2024
    - 169.2K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tfr/passes/raise_to_tf.cc

                                                      StringAttr attr_type) const {
      if (!attr_type) return attr;
    
      if (attr_type.getValue() == "tensor") {
        if (auto f = mlir::dyn_cast<FloatAttr>(attr)) {
          RankedTensorType type = RankedTensorType::get({}, f.getType());
          return DenseFPElementsAttr::get(type, attr);
        }
        // TODO(fengliuai): handles ArrayAttr. Note that it can be nested ArrayAttr.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_a_m.cc

          getOperand().getType() == getType())
        return getOperand();
    
      auto calculate = [&](FloatAttr arg) {
        APFloat val = arg.getValue();
        if (val.isNegative()) val = getAlpha() * val;
        return FloatAttr::get(arg.getType(), val);
      };
    
      if (auto arg = mlir::dyn_cast_or_null<FloatAttr>(operands[0])) {
        return calculate(arg);
      } else if (auto arg =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 146.7K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_n_z.cc

                                     delta_attr);
      } else if (elem_type.isa<FloatType>()) {
        auto start_attr = start_tensor.getValues<FloatAttr>()[0];
        auto limit_attr = limit_tensor.getValues<FloatAttr>()[0];
        auto delta_attr = delta_tensor.getValues<FloatAttr>()[0];
        const int num_elements = GetLengthOfRange(start_attr.getValueAsDouble(),
                                                  limit_attr.getValueAsDouble(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 22:07:10 UTC 2024
    - 170.8K bytes
    - Viewed (0)
Back to top