Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 54 for m_Constant (0.39 sec)

  1. tensorflow/compiler/mlir/lite/transforms/quantize.cc

      LogicalResult matchAndRewrite(QuantizeOp op,
                                    PatternRewriter& rewriter) const override {
        DenseFPElementsAttr attr;
        if (matchPattern(op.getInput(), m_Constant(&attr))) {
          auto qtype = op.getQtypeAttr();
          Attribute quantized_attr;
          if (legacy_float_scale_) {
            quantized_attr = quant::QuantizeLegacy(attr, qtype.getValue());
          } else {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/while_loop_outline.cc

        // Sink down constants (including quantized constant) into the functions.
        for (auto extern_value : region_extern_values) {
          if (!matchPattern(extern_value, m_Constant()) &&
              !llvm::dyn_cast_or_null<TFL::QConstOp>(
                  extern_value.getDefiningOp())) {
            extern_values.insert(extern_value);
            continue;
          }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

      auto new_value_type = mlir::cast<TensorType>(new_value.getType());
    
      // Get multiplier value in double.
      DenseFPElementsAttr multiplier_attr;
      if (!matchPattern(multiplier, m_Constant(&multiplier_attr)) ||
          mlir::cast<ShapedType>(multiplier_attr.getType()).getRank() > 1) {
        return {};
      }
      std::vector<double> multiplier_values;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/preprocess_op.cc

        int weight_operand_idx = *operands.begin();
    
        Operation* weight_op = op.getOperand(weight_operand_idx).getDefiningOp();
        DenseFPElementsAttr attr;
        if (!matchPattern(weight_op->getResult(0), m_Constant(&attr))) {
          return failure();
        }
    
        // Get new shape.
        llvm::ArrayRef<int64_t> cur_shape = attr.getType().getShape();
        int cur_rank = cur_shape.size();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_types.cc

          ConversionPatternRewriter &rewriter) const override {
        if (!IsIllegalType(op.getOutput().getType())) return failure();
        TF::TensorProtoAttr tensor_proto_attr;
        if (!matchPattern(op.getOperation(), m_Constant(&tensor_proto_attr))) {
          return rewriter.notifyMatchFailure(op, "operand must be constant.");
        }
        auto dense_attr_or = GetDenseAttrFromTensorProtoAttr(
            tensor_proto_attr.getValue(),
    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/lite/transforms/reduce_while_operands.cc

          if (consumed_ops.contains(def_op)) continue;
          queue.push_back(def_op);
          consumed_ops.insert(def_op);
        }
      }
    }
    
    inline bool IsConstant(Operation *op) { return matchPattern(op, m_Constant()); }
    
    bool AllOperationSafe(Block &block) {
      auto walk_result = block.walk([&](Operation *op) {
        // op has SideEffect.
        if (!isa_and_nonnull<TFL::WhileOp>(op) &&
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo.cc

    // `SplatValueType` can be `APInt` or `APFloat`.
    template <typename SplatValueType>
    LogicalResult GetConstantSplatValue(Value value, SplatValueType& splat_value) {
      DenseElementsAttr attr;
      if (!matchPattern(value, m_Constant(&attr)) || !attr.isSplat()) {
        return failure();
      }
    
      splat_value = attr.getSplatValue<SplatValueType>();
      return success();
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 154.9K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.h

            // The input of this QuantizeOp has already been quantized, i.e.
            // rescale.
            return failure();
          }
          DenseFPElementsAttr attr;
          if (matchPattern(quantize_operand, m_Constant(&attr))) {
            // Const-> QuantizeOp pattern will be handled separately.
            return failure();
          }
          if (Operation* quantizing_op = quantize_operand.getDefiningOp()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tf2xla/transforms/tf2xla_rewriter.cc

                                           xla::TypeToShape(operand.getType()),
                                           std::to_string(operand_index));
    
      if (defining_op && matchPattern(defining_op, m_Constant(&const_attr))) {
        tensorflow::Tensor tensor;
        auto status = tensorflow::ConvertToTensor(const_attr, &tensor);
        if (!status.ok()) {
          op->emitRemark() << "skipping legalization due to failed const conversion"
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:16:07 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tfr/passes/raise_to_tf.cc

        Attribute arg_value;
        // A failure indicates the argument isn't a constant value, so we should
        // not use it as an attribute.
        if (!matchPattern(input, m_Constant(&arg_value))) {
          return failure();
        }
        auto attr_name = signature.getArgAttrOfType<StringAttr>(
            operand.index(), kAttrArgumentNameAttr);
        auto attr_type = signature.getArgAttrOfType<StringAttr>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 21.8K bytes
    - Viewed (0)
Back to top