Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 33 for MatchPattern (0.41 sec)

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

            legacy_float_scale_(legacy_float_scale) {}
      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());
    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/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)
  3. tensorflow/compiler/mlir/lite/transforms/while_loop_outline.cc

        getUsedValuesDefinedAbove(*it.value(), region_extern_values);
    
        // 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)
  4. tensorflow/compiler/mlir/quantization/tensorflow/passes/preprocess_op.cc

        if (operands.size() != 1) return failure();
        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. maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java

                        return mirror;
                    }
                }
    
                for (Mirror mirror : mirrors) {
                    if (matchPattern(repository, mirror.getMirrorOf()) && matchesLayout(repository, mirror)) {
                        return mirror;
                    }
                }
            }
    
            return null;
        }
    
        /**
    Registered: Wed Jun 12 09:55:16 UTC 2024
    - Last Modified: Sat Feb 17 18:40:11 UTC 2024
    - 32.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/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(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.6K 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()) {
    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);
    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