Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 40 for DenseFPElementsAttr (0.28 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/utils/fake_quant_utils.h

        max_value = tf_op.getMaxAttr();
        return true;  // Successfully matched and fetched.
      }
    };
    
    template <class TFFakeQuantOp>
    struct FetchConstantMinMaxInputs {
      using AttrType = DenseFPElementsAttr;
      bool operator()(TFFakeQuantOp tf_op, AttrType &min_value,
                      AttrType &max_value) const {
        Value min = tf_op.getMin(), max = tf_op.getMax();
        if (auto min_id = min.getDefiningOp<TF::IdentityOp>()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/passes/convert_func_to_bfloat16.cc

                                                                  values->end());
          state.attributes.set(
              const_op.getValueAttrName(),
              DenseFPElementsAttr::get(
                  mlir::dyn_cast<ShapedType>(const_op.getValue().getType())
                      .clone(rewriter.getBF16Type()),
                  bfloat16_values));
        }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/lift_quantizable_spots_as_functions.cc

    }
    
    // Checks whether the value of a constant equals the given float, regardless
    // of the tensor dimension.
    bool FloatValueEquals(const Attribute& attr, const double value) {
      const auto fp_attr = mlir::dyn_cast_or_null<DenseFPElementsAttr>(attr);
      if (!fp_attr) return false;
    
      if (fp_attr.isSplat()) {
        return fp_attr.getSplatValue<APFloat>().isExactlyValue(value);
      }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 10 04:07:09 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/preprocess_op.cc

        if (operands.size() != 1) return failure();
        int weight_operand_idx = *operands.begin();
    
        Operation* weight_op = op.getOperand(weight_operand_idx).getDefiningOp();
        DenseFPElementsAttr attr;
        if (!matchPattern(weight_op->getResult(0), m_Constant(&attr))) {
          return failure();
        }
    
        // Get new shape.
        llvm::ArrayRef<int64_t> cur_shape = attr.getType().getShape();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/stablehlo/passes/insert_weight_param.cc

        return HasValidWeightOnlyPtqMethod(method.weight_only_ptq(), rank);
      }
    
      void rewrite(Operation* op, PatternRewriter& rewriter) const override {
        Operation* quantizable_op = *op->getUsers().begin();
        DenseFPElementsAttr attr;
        matchPattern(op->getResult(0), m_Constant(&attr));
    
        Method method = GetQuantizationMethodOrDefault(quantizable_op);
        const WeightOnlyPtq& weight_only_ptq = method.weight_only_ptq();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 05:56:10 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/compose_uniform_quantized_type_pass.cc

          // This is i8 values disguised as f32 (due to the upcast trick). Simply
          // cast them to i8.
          ElementsAttr filter_value = filter_constant_op.getValue();
          filter_i8_value_attr =
              mlir::cast<DenseFPElementsAttr>(filter_value)
                  .mapValues(rewriter.getI8Type(), [](const APFloat& val) -> APInt {
                    APSInt convertedInt(/*BitWidth=*/8, /*isUnsigned=*/false);
                    bool ignored;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 64.6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/quantize.cc

            legacy_float_scale_(legacy_float_scale) {}
      LogicalResult matchAndRewrite(QuantizeOp op,
                                    PatternRewriter& rewriter) const override {
        DenseFPElementsAttr attr;
        if (matchPattern(op.getInput(), m_Constant(&attr))) {
          auto qtype = op.getQtypeAttr();
          Attribute quantized_attr;
          if (legacy_float_scale_) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/quantization/tensorflow/fallback_to_flex_ops.cc

      return val;
    }
    
    // Returns true if the attr is a float attribute and be equal to value.
    static bool FloatValueEquals(const Attribute &attr, double value) {
      auto fp_attr = mlir::dyn_cast_or_null<DenseFPElementsAttr>(attr);
      if (fp_attr == nullptr) return false;
    
      if (fp_attr.isSplat()) {
        return fp_attr.getSplatValue<APFloat>().isExactlyValue(value);
      }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

      Value new_value = builder.create<TF::MulOp>(loc, float_value, multiplier);
      auto new_value_type = mlir::cast<TensorType>(new_value.getType());
    
      // Get multiplier value in double.
      DenseFPElementsAttr multiplier_attr;
      if (!matchPattern(multiplier, m_Constant(&multiplier_attr)) ||
          mlir::cast<ShapedType>(multiplier_attr.getType()).getRank() > 1) {
        return {};
      }
      std::vector<double> multiplier_values;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/transforms/optimize.cc

        // operand if necessary.
        DenseFPElementsAttr cst;
        if (!matchPattern(binary_op->getOperand(1), m_Constant(&cst)))
          return failure();
        if (cst.getNumElements() != 1) return failure();
        APFloat cst_value = *cst.value_begin<APFloat>();
    
        // Affine op.
        Value filter = fc_op.getFilter();
        Value bias = fc_op.getBias();
        DenseFPElementsAttr filter_cst, bias_cst;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 102.3K bytes
    - Viewed (0)
Back to top