Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for DenseFPElementsAttr (0.24 sec)

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

      }
    
      return nullptr;
    }
    
    /// Converts a real expressed DenseFPElementsAttr to a corresponding
    /// DenseElementsAttr (typically DenseIntElementsAttr) containing quantized
    /// storage values assuming the given quantizedElementType and converter.
    static DenseElementsAttr convertDenseFPElementsAttr(
        DenseFPElementsAttr realFPElementsAttr,
        quant::QuantizedType quantizedElementType,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/common/ir/UniformSupport.cc

    }
    
    ElementsAttr UniformQuantizedPerAxisValueConverter::convert(
        Attribute real_value) {
      if (auto attr = dyn_cast<DenseFPElementsAttr>(real_value)) {
        return convert(attr);
      }
      return nullptr;
    }
    
    DenseElementsAttr UniformQuantizedPerAxisValueConverter::convert(
        DenseFPElementsAttr attr) {
      // Creates the converter for each chunk. Normally the size of the
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/fold_constant_transpose.cc

        return success(
            mlir::isa_and_nonnull<DenseFPElementsAttr>(const_op.getValue()));
      }
    
      void rewrite(mlir::stablehlo::TransposeOp op,
                   PatternRewriter& rewriter) const override {
        auto const_op =
            cast<mlir::stablehlo::ConstantOp>(op.getOperand().getDefiningOp());
    
        const auto value_attr =
            mlir::cast<DenseFPElementsAttr>(const_op.getValue());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_avg_pool.h

    // Get dense attr for a matrix that corrects the over counting of divisors when
    // casting an average pool with ceil mode on in terms of average pool with it
    // off.
    DenseFPElementsAttr GetCorrectionMatrix(Builder& builder, mhlo::CompositeOp op);
    
    }  // namespace odml
    }  // namespace mlir
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 23:16:05 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/transforms/optimize_batch_matmul.cc

        rewriter.replaceOp(bmm_op, sum_op);
        return success();
      };
    
     private:
      bool SplatValueEquals(SplatElementsAttr float_or_int, double rhs) const {
        if (mlir::isa<DenseFPElementsAttr>(float_or_int)) {
          return mlir::cast<DenseFPElementsAttr>(float_or_int)
              .getSplatValue<APFloat>()
              .isExactlyValue(rhs);
        } else if (mlir::cast<DenseIntElementsAttr>(float_or_int)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/rewrite_util.h

    // to `raw_value`.
    template <typename T>
    bool IsConstantValueOf(Value value, T raw_value) {
      auto element_type = mlir::cast<ShapedType>(value.getType()).getElementType();
      if (mlir::isa<FloatType>(element_type)) {
        DenseFPElementsAttr float_attr;
        if (matchPattern(value, m_Constant(&float_attr)) && float_attr.isSplat() &&
            float_attr.getSplatValue<APFloat>().isExactlyValue(raw_value))
          return true;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 22 19:47:48 UTC 2024
    - 4K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_avg_pool.cc

        }
      }
      return res;
    }
    
    // Gets a matrix which corrects the overcounting of divisors when casting a
    // average pool with ceil mode true as one with ceil mode false on a padded
    // tensor.
    DenseFPElementsAttr GetCorrectionMatrix(Builder& builder, CompositeOp op) {
      const TorchAvgPoolData pool = GetTorchAvgPoolData(op);
    
      llvm::SmallVector<int64_t, 4> nhwc_out_shape(4);
      nhwc_out_shape[0] = 1;  // Broadcast batch.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 23:16:05 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/tensorflow/passes/convert_custom_aggregation_op_to_quant_stats.cc

          op.getOutput().replaceAllUsesWith(op.getInput());
          rewriter.eraseOp(op);
          return success();
        }
    
        // The layer stats contain only the first min/max pairs.
        ElementsAttr layer_stats = DenseFPElementsAttr::get(
            RankedTensorType::get({2}, rewriter.getF32Type()),
            {static_cast<float>(min.getValueAsDouble()),
             static_cast<float>(max.getValueAsDouble())});
        ElementsAttr axis_stats;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/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 (!matchPattern(min, m_Constant(&min_value))) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/stablehlo/passes/post_quantize.cc

      LogicalResult matchAndRewrite(mlir::stablehlo::UniformQuantizeOp op,
                                    PatternRewriter& rewriter) const override {
        DenseFPElementsAttr attr;
        if (matchPattern(op.getOperand(), m_Constant(&attr))) {
          const Type qtype = op.getResult().getType();
          ElementsAttr quantized_attr = Quantize(attr, qtype);
          if (quantized_attr) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 6.3K bytes
    - Viewed (0)
Back to top