Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 82 for matchAndRewrite (0.23 sec)

  1. tensorflow/compiler/mlir/lite/transforms/optimize_op_order.cc

    struct PushDownDequantize : public OpRewritePattern<DequantizeOp> {
      explicit PushDownDequantize(MLIRContext* context)
          : OpRewritePattern<DequantizeOp>(context) {}
    
      LogicalResult matchAndRewrite(DequantizeOp dequantize_op,
                                    PatternRewriter& rewriter) const override {
        if (!dequantize_op->hasOneUse()) return failure();
    
        auto use = dequantize_op->use_begin();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/decompose_hybrid_quantization.cc

      void runOnOperation() override;
    };
    
    template <typename SrcOp>
    class DequantizeConverter : public OpRewritePattern<SrcOp> {
     public:
      using OpRewritePattern<SrcOp>::OpRewritePattern;
    
      LogicalResult matchAndRewrite(SrcOp srcop,
                                    PatternRewriter &rewriter) const final {
        Operation *op = srcop.getOperation();
        bool allTypesFp = true;
        bool allTypesQuantizedOrInt = true;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/merge_fusion_with_dequantize.cc

        : public OpRewritePattern<func::CallOp> {
     public:
      explicit MergeFusionWithUniformDequantizePattern(MLIRContext* context)
          : OpRewritePattern<func::CallOp>(context) {}
      LogicalResult matchAndRewrite(func::CallOp call_op,
                                    PatternRewriter& rewriter) const override {
        if (call_op.getNumResults() != 1) return failure();
        auto users = call_op->getUsers();
        for (auto user : users) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.h

            num_bits(num_bits),
            narrow_range(narrow_range),
            is_signed(is_signed),
            legacy_float_scale(legacy_float_scale) {}
    
      LogicalResult matchAndRewrite(quantfork::StatisticsOp op,
                                    PatternRewriter& rewriter) const override {
        Type expressed = op.getType().cast<ShapedType>().getElementType();
        quant::QuantizedType quant_type;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/reduce.h

              bool is_argmax>
    class ConvertReduceOpToArgMinMax : public OpConversionPattern<mhlo::ReduceOp> {
     public:
      using OpConversionPattern::OpConversionPattern;
      LogicalResult matchAndRewrite(
          mhlo::ReduceOp reduce_op, OpAdaptor adaptor,
          ConversionPatternRewriter& rewriter) const final {
        if (reduce_op.getInputs().size() != 2) return failure();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/quantization/ir/ConvertSimQuant.cc

     public:
      using OpRewritePattern<FakeQuantOp>::OpRewritePattern;
    
      FakeQuantRewrite(MLIRContext *ctx, bool *hadFailure)
          : OpRewritePattern<FakeQuantOp>(ctx), hadFailure(hadFailure) {}
    
      LogicalResult matchAndRewrite(FakeQuantOp op,
                                    PatternRewriter &rewriter) const override {
        // TODO: If this pattern comes up more frequently, consider adding core
        // support for failable rewrites.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/ir/tf_executor.cc

    // results of the GraphOp to the operands of the FetchOp.
    struct DropEmptyGraph : public OpRewritePattern<GraphOp> {
      using OpRewritePattern<GraphOp>::OpRewritePattern;
    
      LogicalResult matchAndRewrite(GraphOp op,
                                    PatternRewriter &rewriter) const override {
        Block &block = op.GetBody();
        // Check if graph only has one fetch.
        if (&block.front() != &block.back()) return failure();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/transforms/prepare_tf.cc

            intAttrOne(Builder(context).getI32IntegerAttr(1)),
            allow_bf16_and_f16_type_legalization_(
                allow_bf16_and_f16_type_legalization) {}
    
      LogicalResult matchAndRewrite(Operation *op,
                                    PatternRewriter &rewriter) const override {
        // Assumes TensorFlow convolution op is already verified to be
        // in valid form.
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 21:49:50 UTC 2024
    - 64.6K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/utils/fake_quant_utils.h

          : use_fake_quant_num_bits_(use_fake_quant_num_bits) {}
    
      FetchMinMax fetch_min_max_;
    
      using FetchAttrType = typename FetchMinMax::AttrType;
      LogicalResult matchAndRewrite(TFFakeQuantOp tf_op,
                                    OpBuilder &rewriter) const {
        // We don't want to insert quantize/dequantize if the quantize op exists.
        auto res = tf_op.getOutputs();
    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/tensorflow/ir/tf_ops_n_z.cc

     public:
      explicit HoistCwiseUnaryOutOfUnpack(MLIRContext *context)
          : OpRewritePattern<UnpackOp>(context) {}
      LogicalResult matchAndRewrite(UnpackOp op,
                                    PatternRewriter &rewriter) const override;
    };
    
    LogicalResult HoistCwiseUnaryOutOfUnpack::matchAndRewrite(
        UnpackOp op, PatternRewriter &rewriter) const {
      auto loc = op.getLoc();
    
    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