Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 100 for matchAndRewrite (0.57 sec)

  1. 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)
  2. tensorflow/compiler/mlir/tensorflow/transforms/einsum.h

    struct ConvertTFEinsumOp : public OpRewritePattern<TF::EinsumOp> {
     public:
      explicit ConvertTFEinsumOp(MLIRContext* context)
          : OpRewritePattern<TF::EinsumOp>(context) {}
    
      LogicalResult matchAndRewrite(TF::EinsumOp op,
                                    PatternRewriter& rewriter) const override;
    };
    
    }  // namespace TF
    }  // namespace mlir
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Dec 12 02:01:03 UTC 2020
    - 2.1K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/tensorflow/passes/remove_identity_op_pattern.cc

    #include "mlir/Transforms/GreedyPatternRewriteDriver.h"  // from @llvm-project
    #include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
    
    namespace mlir {
    namespace quant {
    
    LogicalResult RemoveIdentity::matchAndRewrite(TF::IdentityOp identity,
                                                  PatternRewriter &rewriter) const {
      for (Operation *user : identity->getUsers()) {
        // Replace the op with the input if output is only used by TF ops.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Feb 15 06:13:49 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/convert_tf_control_flow_to_scf.cc

    }
    
    /// Convert the `tf.IfRegion` op to the `scf.if` op.
    class ConvertIfRegionOp : public OpRewritePattern<IfRegionOp> {
     public:
      using OpRewritePattern<IfRegionOp>::OpRewritePattern;
    
      LogicalResult matchAndRewrite(IfRegionOp op,
                                    PatternRewriter& rewriter) const override {
        // Creates the `then` or `else` region of the `scf.if` op. Note that
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 9.4K bytes
    - Viewed (0)
  5. 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)
  6. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_canonicalization_helper.h

    // during import.
    template <typename Op>
    struct DropAttributes : public OpRewritePattern<Op> {
      using OpRewritePattern<Op>::OpRewritePattern;
    
      // Drop the "output_shapes" attribute.
      LogicalResult matchAndRewrite(Op op,
                                    PatternRewriter &rewriter) const override {
        bool found = !!op->removeAttr("output_shapes");
        return success(found);
      }
    };
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Nov 12 21:57:12 UTC 2021
    - 2.4K 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