Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 31 for SetArg (0.33 sec)

  1. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.cc

      // quant.qcast op in case it overrides the information from training FakeQuant
      // ops.
      func.walk([&](quantfork::QuantizeCastOp q) {
        auto input_op = q.getArg().getDefiningOp();
        if (auto stats = dyn_cast_or_null<quantfork::StatisticsOp>(input_op)) {
          q.setOperand(stats.getArg());
          if (stats.use_empty()) stats.erase();
        }
      });
    
      // Step 1: forward pass: propagate any value scales which are not produces
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_quantize.cc

                                    PatternRewriter& rewriter) const override {
        auto preceding_qcast =
            q_op.getArg().getDefiningOp<quantfork::QuantizeCastOp>();
        if (!preceding_qcast) return failure();
    
        auto new_qcast = rewriter.create<quantfork::QuantizeCastOp>(
            q_op.getLoc(), q_op.getType(), preceding_qcast.getArg());
        new_qcast->setAttr(kVolatileOpAttrName, rewriter.getUnitAttr());
        q_op->replaceAllUsesWith(new_qcast);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/tensorflow/passes/quantize_composite_functions.cc

            return failure();
          }
          output_types = {new_output_type};
        } else {
          output_types = {output_type.clone(elem_type.getStorageType())};
        }
    
        SmallVector<Value> args = {q_op.getArg(), scale, zero_point};
        FlatSymbolRefAttr func_name =
            FlatSymbolRefAttr::get(rewriter.getStringAttr(kQuantizeFuncName));
    
        auto quantize_call = rewriter.create<TF::PartitionedCallOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 54.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/fuse_convolution_pass.cc

                  .getOutputDimensions()
                  .getDefiningOp<shape::ShapeOfOp>();
          // Check if the shape come from the original conv op.
          if (!shape_of_op ||
              shape_of_op.getArg().getDefiningOp<mhlo::ConvolutionOp>() !=
                  conv_op) {
            return failure();
          }
          Value new_shape_of = rewriter.create<shape::ShapeOfOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 22:21:19 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_quantize_drq.cc

    void PrepareQuantizeDRQPass::removeAllStatsOp(func::FuncOp func) {
      func.walk([&](quantfork::StatisticsOp stats_op) {
        stats_op.replaceAllUsesWith(stats_op.getArg());
        stats_op.erase();
      });
    }
    
    #include "tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_quantize.inc"
    
    void PrepareQuantizeDRQPass::runOnOperation() {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.h

        auto q =
            rewriter.create<QuantizeOpT>(op.getLoc(), result_type, op.getArg());
        q->setAttr(kVolatileOpAttrName, rewriter.getUnitAttr());
    
        auto dq = rewriter.create<DequantizeOpT>(op.getLoc(), op.getType(), q);
        op.getResult().replaceAllUsesWith(dq);
        q.getOperation()->replaceUsesOfWith(dq, op.getArg());
        op.erase();
    
        return success();
      }
    
     private:
      int num_bits;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tfr/ir/tfr_ops.td

      let extraClassDeclaration = [{
        // Return element type of the input tensor type. Only available when the
        // input is a MLIR built-in tensor type.
        Attribute getInputElementType() {
          if (auto ty = getArg().getType().dyn_cast<TensorType>()) {
            return TypeAttr::get(ty.getElementType());
          }
          return {};
        }
      }];
    
      let hasCanonicalizer = 1;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 10:54:29 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver.cc

      for (int i = 0; i < op->getNumOperands(); ++i) {
        if (auto dq_op = dyn_cast_or_null<quantfork::DequantizeCastOp>(
                op->getOperand(i).getDefiningOp())) {
          auto type =
              mlir::cast<TensorType>(dq_op.getArg().getType()).getElementType();
          if (auto per_axis_qtype =
                  mlir::dyn_cast_or_null<quant::UniformQuantizedPerAxisType>(
                      QuantizedType::getQuantizedElementType(type))) {
            return true;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 38.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_dynamic_range.cc

    void PrepareDynamicRangeQuantizePass::removeAllStatsOp(func::FuncOp func) {
      func.walk([&](quantfork::StatisticsOp stats_op) {
        stats_op.replaceAllUsesWith(stats_op.getArg());
        stats_op.erase();
      });
    }
    
    void PrepareDynamicRangeQuantizePass::runOnOperation() {
      func::FuncOp func = getOperation();
      MLIRContext* ctx = func.getContext();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 20.8K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantization_patterns.cc

      for (const Value operand : same_scale_op->getOperands()) {
        auto dq_op =
            dyn_cast_or_null<quantfork::DequantizeCastOp>(operand.getDefiningOp());
        if (!dq_op) continue;
    
        Operation* preceding_op = dq_op.getArg().getDefiningOp();
        if (!preceding_op) continue;
    
        // Check whether the preceding op is a quantized composite function.
        if (isa<func::CallOp>(preceding_op)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 06:04:36 UTC 2024
    - 41.7K bytes
    - Viewed (0)
Back to top