Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for ReplaceOpWithNewOp (0.41 sec)

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

        auto table_id =
            static_cast<int32_t>(::llvm::hash_value(hashtable_op.getSharedName()));
        auto key_dtype = hashtable_op.getKeyDtype();
        auto value_dtype = hashtable_op.getValueDtype();
    
        rewriter.replaceOpWithNewOp<TFL::HashtableOp>(
            hashtable_op, output_type, table_id, key_dtype, value_dtype);
        return success();
      }
    };
    
    class LegalizeHashTableFindOpPattern
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/transforms/tfg-to-tfe.cc

     public:
      using OpConversionPattern::OpConversionPattern;
      LogicalResult matchAndRewrite(
          tfg::ReturnOp ret, OpAdaptor adaptor,
          ConversionPatternRewriter &rewriter) const final {
        rewriter.replaceOpWithNewOp<tf_executor::FetchOp>(ret.getOperation(),
                                                          adaptor.getOperands());
        return success();
      }
    };
    
    class ConvertControlTriggerOp : public ConversionPattern {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/post_quantize.cc

          if (const QuantizedType qtype =
                  QuantizedType::getQuantizedElementType(q.getArg().getType())) {
            rewriter.setInsertionPoint(op);
            rewriter.replaceOpWithNewOp<quantfork::DequantizeCastOp>(
                op, op.getResult().getType(), q.getArg());
            return success();
          }
    
          op.replaceAllUsesWith(q.getArg());
          return success();
        }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/transforms/legalize_tf.cc

      IntegerAttr axis_i32;
      if (failed(ConvertToI32Attr(axis_int, &axis_i32))) return failure();
    
      StringAttr fused_activation_function =
          StringAttr::get(rewriter.getContext(), "NONE");
      rewriter.replaceOpWithNewOp<ConcatenationOp>(
          op, output_type, values, axis_i32, fused_activation_function);
      return success();
    }
    
    template <typename BatchMatMulOpType>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 20 20:06:54 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/stablehlo/transforms/optimize.cc

          rhs_type.getRank() < 1 || 2 < rhs_type.getRank()) {
        return rewriter.notifyMatchFailure(
            op,
            "unsupported dot operation type; operands must be vectors or "
            "matrices");
      }
      rewriter.replaceOpWithNewOp<mhlo::DotGeneralOp>(
          op, op.getType(), op.getLhs(), op.getRhs(),
          mhlo::DotDimensionNumbersAttr::get(
              op.getContext(),
              /*lhsBatchingDimensions=*/{},
              /*rhsBatchingDimensions=*/{},
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 26.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_ops_to_mhlo.cc

        }
    
        auto rhs_or =
            CreateConstantOrConvertOp(op, adaptor.getRhs(), *rhs_type, rewriter);
        if (failed(rhs_or)) {
          return failure();
        }
    
        rewriter.replaceOpWithNewOp<mhlo::DotOp>(op, op.getType(), op.getLhs(),
                                                 *rhs_or,
                                                 /*precision_config=*/nullptr);
        return success();
      }
    };
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 30.9K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/decompose_optionals.cc

                                    PatternRewriter& rewriter) const override {
        Value value = nullptr;
        for (auto v : op.getComponents()) {
          value = v;
        }
        if (!value) return failure();
        rewriter.replaceOpWithNewOp<TF::IdentityOp>(op, value.getType(), value);
        return success();
      }
    };
    
    class HandleOptionalGet : public OpRewritePattern<TF::OptionalGetValueOp> {
     public:
      using OpRewritePattern::OpRewritePattern;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:18:05 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/passes/prepare_quantize.cc

     public:
      using OpRewritePattern::OpRewritePattern;
      LogicalResult matchAndRewrite(TF::ConstOp op,
                                    PatternRewriter& rewriter) const override {
        rewriter.replaceOpWithNewOp<arith::ConstantOp>(op, op.getValue());
        return success();
      }
    };
    
    class ConvertStablehloConstToArithConstOp
        : public OpRewritePattern<mlir::stablehlo::ConstantOp> {
     public:
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 03 05:11:03 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/convert_tf_control_flow_to_scf.cc

            scf_yield_input.push_back(rewriter.create<CastOp>(
                current_terminator->getLoc(), std::get<0>(it), std::get<1>(it)));
          }
    
          rewriter.replaceOpWithNewOp<scf::YieldOp>(current_terminator,
                                                    scf_yield_input);
        };
    
        Location loc = op.getLoc();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 9.4K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/stablehlo/transforms/uniform_quantized_stablehlo_to_tfl_pass.cc

        return success();
      }
    
      void rewrite(stablehlo::UniformQuantizeOp op,
                   PatternRewriter& rewriter) const override {
        Type output_type = *op->getResultTypes().begin();
        rewriter.replaceOpWithNewOp<TFL::QuantizeOp>(
            op, output_type, /*input=*/op.getOperand(),
            /*qtype=*/TypeAttr::get(output_type));
      }
    };
    
    // stablehlo.uniform_dequantize -> tfl.dequantize
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 09:00:19 UTC 2024
    - 99.8K bytes
    - Viewed (0)
Back to top