Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for StorageCastOp (0.17 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/passes/quantize.cc

    // added to TF and XLA.
    struct QuantizeAvgPoolOpPattern
        : public OpRewritePattern<quantfork::StorageCastOp> {
      explicit QuantizeAvgPoolOpPattern(MLIRContext* context)
          : OpRewritePattern<quantfork::StorageCastOp>(context, /*benefit=*/100) {}
    
      LogicalResult matchAndRewrite(quantfork::StorageCastOp sc_op,
                                    PatternRewriter& rewriter) const override {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 22 05:52:39 UTC 2024
    - 23.6K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/post_quantize.cc

          return success();
        }
        return failure();
      }
    };
    
    // The StorageCastOp is used to cast from a quantized type to its storage type
    // or the opposite. If none of its input and output is quantized, the op has
    // no effect and should be removed.
    class RemoveRedundantScast
        : public mlir::OpRewritePattern<quantfork::StorageCastOp> {
     public:
      explicit RemoveRedundantScast(MLIRContext* context)
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/common/ir/QuantOps.cc

    #define GET_OP_LIST
    #include "tensorflow/compiler/mlir/quantization/common/ir/QuantOps.cc.inc"
          >();
    }
    
    OpFoldResult StorageCastOp::fold(FoldAdaptor) {
      // Matches x -> [scast -> scast] -> y, replacing the second scast with the
      // value of x if the casts invert each other.
      auto srcScastOp = getArg().getDefiningOp<StorageCastOp>();
      if (!srcScastOp || srcScastOp.getArg().getType() != getType())
        return OpFoldResult();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/quantization/ir/QuantOps.cc

    #define GET_OP_LIST
    #include "tensorflow/compiler/mlir/lite/quantization/ir/QuantOps.cc.inc"
          >();
    }
    
    OpFoldResult StorageCastOp::fold(FoldAdaptor) {
      // Matches x -> [scast -> scast] -> y, replacing the second scast with the
      // value of x if the casts invert each other.
      auto srcScastOp = getArg().getDefiningOp<StorageCastOp>();
      if (!srcScastOp || srcScastOp.getArg().getType() != getType())
        return OpFoldResult();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/tensorflow/passes/quantize_composite_functions.cc

              return failure();
            }
            scast_op = rewriter.create<quantfork::StorageCastOp>(
                arg.getLoc(), mlir::cast<TensorType>(new_arg_type), arg);
          } else {
            scast_op = rewriter.create<quantfork::StorageCastOp>(
                arg.getLoc(), arg_type.clone(qtype.getStorageType()), arg);
          }
          args.push_back(scast_op.getResult());
        }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 54.5K bytes
    - Viewed (0)
  6. 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() {
      RewritePatternSet patterns(&getContext());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.4K bytes
    - Viewed (0)
Back to top