Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 85 for matchAndRewrite (0.31 sec)

  1. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/custom_call.cc

    #include "tensorflow/compiler/mlir/lite/ir/tfl_ops.h"  // IWYU pragma: keep
    #include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"
    
    namespace mlir {
    namespace odml {
    
    LogicalResult ConvertCustomCallOp::matchAndRewrite(
        mhlo::CustomCallOp mhlo_custom_call, OpAdaptor adaptor,
        ConversionPatternRewriter& rewriter) const {
      auto tfl_custom = rewriter.create<TFL::CustomOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/cc/constant_fold.h

    struct ConstantFoldQuantizableOperands : public RewritePattern {
     public:
      explicit ConstantFoldQuantizableOperands(MLIRContext* context)
          : RewritePattern(MatchAnyOpTypeTag(), /*benefit=*/1, context) {}
      LogicalResult matchAndRewrite(Operation* op,
                                    PatternRewriter& rewriter) const override;
    };
    
    }  // namespace quant
    }  // namespace mlir
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jul 04 14:27:31 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform.cc

    // Fold quantized i32 (normally bias) into their float values.
    struct FoldQuantizedI32ToFloat : public OpRewritePattern<TFL::DequantizeOp> {
      using OpRewritePattern<TFL::DequantizeOp>::OpRewritePattern;
    
      LogicalResult matchAndRewrite(TFL::DequantizeOp dequant_op,
                                    PatternRewriter& rewriter) const override {
        // We only fold i32 -> float pattern.
        auto input = dequant_op.getInput().getDefiningOp();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/optimize_layout.cc

    }
    
    // Transform pad(transpose(x)) to transpose(pad(x))
    struct TransposeCommuteWithPad : public OpRewritePattern<stablehlo::PadOp> {
      using OpRewritePattern<stablehlo::PadOp>::OpRewritePattern;
    
      LogicalResult matchAndRewrite(stablehlo::PadOp pad_op,
                                    PatternRewriter& rewriter) const override {
        Value pad_input = pad_op.getOperand();
        RankedTensorType pad_type = pad_op.getType().cast<RankedTensorType>();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 21:59:06 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/stablehlo/passes/xla_call_module_to_call.cc

    class XlaCallModuleOpToCallOp : public OpRewritePattern<TF::XlaCallModuleOp> {
     public:
      explicit XlaCallModuleOpToCallOp(MLIRContext* context)
          : OpRewritePattern<TF::XlaCallModuleOp>(context) {}
    
      LogicalResult matchAndRewrite(TF::XlaCallModuleOp op,
                                    PatternRewriter& rewriter) const override {
        auto module_op = op->getParentOfType<ModuleOp>();
        SymbolTable symbol_table(module_op);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 04 20:02:00 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_types.cc

    class TFQuantTypePattern : public ConversionPattern {
     public:
      TFQuantTypePattern(MLIRContext *ctx, TypeConverter &converter)
          : ConversionPattern(converter, MatchAnyOpTypeTag(), 1, ctx) {}
    
      LogicalResult matchAndRewrite(
          Operation *op, ArrayRef<Value> operands,
          ConversionPatternRewriter &rewriter) const override {
        // This pattern only handle non-UQ, non-const ops.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/lower_tf.cc

     public:
      explicit LowerAddNOp(MLIRContext *context)
          : RewritePattern(AddNOp::getOperationName(), 1, context,
                           {AddV2Op::getOperationName()}) {}
    
      LogicalResult matchAndRewrite(Operation *op,
                                    PatternRewriter &rewriter) const override {
        auto addn_op = cast<AddNOp>(op);
    
        // TODO(hinsu): Support variant with TensorList type. tf.AddV2 doesn't
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 74.9K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

    template <typename SourceOp>
    class PrepareLstmOutputScale : public OpRewritePattern<SourceOp> {
     public:
      explicit PrepareLstmOutputScale(MLIRContext* context)
          : OpRewritePattern<SourceOp>(context) {}
      LogicalResult matchAndRewrite(SourceOp op,
                                    PatternRewriter& rewriter) const override {
        operator_property::OpVariant lstm_variant;
        operator_property::OperatorProperty lstm_property;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/stablehlo/transforms/unfuse_batch_norm_pass.cc

    }
    
    class UnfuseBatchNormTrainingPattern
        : public OpRewritePattern<mhlo::BatchNormTrainingOp> {
     public:
      using OpRewritePattern<mhlo::BatchNormTrainingOp>::OpRewritePattern;
    
      LogicalResult matchAndRewrite(mhlo::BatchNormTrainingOp bn_op,
                                    PatternRewriter &rewriter) const override {
        auto inputs = bn_op.getOperand();
        auto input_type = mlir::dyn_cast<RankedTensorType>(inputs.getType());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/stablehlo/passes/convert_func_to_bfloat16.cc

     public:
      BFloat16TypePattern(TypeConverter& converter, MLIRContext* ctx)
          : ConversionPattern(converter, MatchAnyOpTypeTag(), /*benefit=*/1, ctx) {}
    
      LogicalResult matchAndRewrite(
          Operation* op, const ArrayRef<Value> operands,
          ConversionPatternRewriter& rewriter) const override {
        if (getTypeConverter()->isLegal(op)) {
          return failure();
        }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.3K bytes
    - Viewed (0)
Back to top