Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for ReplaceOpWithNewOp (0.35 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/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)
  3. 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)
  4. 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)
  5. tensorflow/compiler/mlir/quantization/stablehlo/passes/xla_call_module_to_call.cc

            symbol_table.lookup(GetEntryFunctionName(op)));
        if (!entry_func_op) return failure();
    
        // Replace the XlaCallModuleOp with a new CallOp.
        rewriter.replaceOpWithNewOp<func::CallOp>(op, entry_func_op, op.getArgs());
        return success();
      }
    };
    
    void XlaCallModuleToCallPass::runOnOperation() {
      ModuleOp module_op = getOperation();
      MLIRContext* ctx = module_op.getContext();
    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/tensorflow/transforms/batchmatmul_to_einsum.cc

        std::string equation("...mk,...kn->...mn");
        if (op.getAdjX()) std::swap(equation[3], equation[4]);
        if (op.getAdjY()) std::swap(equation[6 + 3], equation[6 + 4]);
    
        rewriter.replaceOpWithNewOp<TF::EinsumOp>(
            op, op.getType(),
            /*inputs=*/ValueRange({input_lhs, input_rhs}),
            /*equation=*/equation);
    
        return success();
      }
    };
    
    #define GEN_PASS_DEF_BATCHMATMULTOEINSUMPASS
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/stablehlo/passes/convert_func_to_bfloat16.cc

          const Value output = rewriter.create<mlir::stablehlo::BitcastConvertOp>(
              op->getLoc(), op.getResult().getType(), adaptor.getOperand());
          rewriter.replaceOpWithNewOp<mlir::stablehlo::ConvertOp>(
              op, getTypeConverter()->convertType(op.getResult().getType()),
              output);
        } else if (is_output_legal) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/quantization/ir/ConvertConst.cc

          {qbarrier.getArg().getDefiningOp()->getLoc(), qbarrier.getLoc()});
      auto newConstOp = rewriter.create<arith::ConstantOp>(
          fusedLoc, newConstValueType, cast<TypedAttr>(newConstValue));
      rewriter.replaceOpWithNewOp<StorageCastOp>(qbarrier, qbarrier.getType(),
                                                 newConstOp);
      return success();
    }
    
    void ConvertConstPass::runOnOperation() {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/tensorflow/passes/post_quantize.cc

          if (auto 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
    - 5.6K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/folders.cc

          return failure();
        }
        res.push_back(signed_lhs_val / signed_rhs_val);
      }
    
      auto res_attr = DenseElementsAttr::get(
          const_oprs[0].getType().cast<RankedTensorType>(), res);
      rewriter.replaceOpWithNewOp<stablehlo::ConstantOp>(adaptor.value().Op(),
                                                         res_attr);
      return success();
    }
    
    static LogicalResult FoldDivOp(stablehlo::DivOp op, PatternRewriter& rewriter) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 06:11:55 UTC 2024
    - 4.5K bytes
    - Viewed (0)
Back to top