Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 19 of 19 for m_Constant (0.84 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/utils/tf_to_xla_attribute_utils_test.cc

      Value packed_value = PackOperand(builder, module->getLoc(), value, pack_dim);
      DenseIntElementsAttr packed_value_attr;
      ASSERT_TRUE(matchPattern(packed_value, m_Constant(&packed_value_attr)));
    
      ShapedType packed_shape_type =
          mlir::dyn_cast<ShapedType>(packed_value.getType());
      llvm::SmallVector<int64_t> packed_shape(packed_shape_type.getShape().begin(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/quantization/ir/ConvertConst.cc

    LogicalResult QuantizedConstRewrite::matchAndRewrite(
        QuantizeCastOp qbarrier, PatternRewriter &rewriter) const {
      Attribute value;
    
      // Is the operand a constant?
      if (!matchPattern(qbarrier.getArg(), m_Constant(&value))) {
        return failure();
      }
    
      // Does the qbarrier convert to a quantized type. This will not be true
      // if a quantized type has not yet been chosen or if the cast to an equivalent
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/post_quantize.cc

      LogicalResult matchAndRewrite(mlir::stablehlo::UniformQuantizeOp op,
                                    PatternRewriter& rewriter) const override {
        DenseFPElementsAttr attr;
        if (matchPattern(op.getOperand(), m_Constant(&attr))) {
          const Type qtype = op.getResult().getType();
          ElementsAttr quantized_attr = Quantize(attr, qtype);
          if (quantized_attr) {
            rewriter.replaceOpWithNewOp<mlir::stablehlo::ConstantOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/init_text_file_to_import.cc

          return failure();
        }
    
        // Try to find filename from constant op.
        DenseStringElementsAttr filename_attr;
        if (!matchPattern(op.getFilename().getDefiningOp(),
                          m_Constant(&filename_attr))) {
          return failure();
        }
    
        if (filename_attr.getRawStringData().size() != 1) {
          return failure();
        }
        std::string filename = filename_attr.getRawStringData()[0].str();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 6.1K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/utils/utils.td

      "TFL::AreLastTwoDimsTransposed($0)">>;
    
    // Checks if the param passed is of NoneType.
    def IsNoneType : Constraint<CPred<"$0.getType().isa<NoneType>()">>;
    
    def ConstantLikePred : CPred<"::mlir::matchPattern($0, ::mlir::m_Constant())">;
    def IsConstantLike : Constraint<ConstantLikePred>;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/experimental/common/outline_operations.cc

    namespace mlir {
    namespace TFL {
    namespace common {
    
    bool IsConstantOrNone(Operation* op) {
      return (op->getNumResults() == 1 &&
              mlir::isa<NoneType>(op->getResult(0).getType())) ||
             matchPattern(op, m_Constant()) || isa<QConstOp>(op);
    }
    
    // Pre-order traverse, adding results and BlockArgs to `been_defined` and
    // collecting operands not contained within `been_defined`. If we encounter an
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/transforms/optimize_functional_ops.cc

          rewriter.eraseOp(op.getOperation());
          return success();
        }
    
        // Extract the constant cond value.
        DenseElementsAttr cond;
        if (!matchPattern(op.getCond(), m_Constant(&cond))) return failure();
    
        // TODO(hinsu): Handle constants that are not scalar booleans.
        auto cond_type = mlir::dyn_cast<RankedTensorType>(cond.getType());
        if (!cond_type || !cond_type.getShape().equals({}) ||
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/transforms/decompose_resource_ops.cc

                                    PatternRewriter &rewriter) const override {
        auto rng_op = cast<RngReadAndSkipOp>(op);
    
        DenseIntElementsAttr alg_constant;
        if (!matchPattern(rng_op.getAlg(), m_Constant(&alg_constant))) {
          return rewriter.notifyMatchFailure(
              op, "unable to determine algorithm statically");
        }
    
        if (alg_constant.getNumElements() != 1) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 03 12:35:38 UTC 2022
    - 8.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/utils/attribute_utils.h

        Operation *op = result.getOwner();
        if (!isa<IdentityOp>(op) && !isa<IdentityNOp>(op)) break;
        val = op->getOperand(result.getResultNumber());
      }
      return matchPattern(val, m_Constant(&attr));
    }
    
    // Checks if both compilation and replication attributes are present in the
    // operation, and if their values are valid.
    LogicalResult HasValidCompilationAndReplicationAttributes(Operation &op);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 22 19:47:48 UTC 2024
    - 8.7K bytes
    - Viewed (0)
Back to top