Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for m_Constant (0.14 sec)

  1. tensorflow/compiler/mlir/tensorflow/transforms/rewrite_util.h

        DenseFPElementsAttr float_attr;
        if (matchPattern(value, m_Constant(&float_attr)) && float_attr.isSplat() &&
            float_attr.getSplatValue<APFloat>().isExactlyValue(raw_value))
          return true;
      } else if (mlir::isa<IntegerType>(element_type)) {
        DenseIntElementsAttr int_attr;
        if (matchPattern(value, m_Constant(&int_attr)) && int_attr.isSplat() &&
            int_attr.getSplatValue<APInt>() == raw_value)
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 22 19:47:48 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/optimize_batch_matmul.cc

      LogicalResult matchAndRewrite(TFL::BatchMatMulOp bmm_op,
                                    PatternRewriter& rewriter) const override {
        DenseElementsAttr constant;
        if (auto rhs = bmm_op.getY(); !matchPattern(rhs, m_Constant(&constant))) {
          // The constant may be preceded by QDQs in models with QDQ format, so we
          // should set it to the real constant.
          auto dq = dyn_cast_or_null<DequantizeOp>(rhs.getDefiningOp());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/quantization/tensorflow/tf_to_quant.cc

          id2.replaceAllUsesWith(id2.getInput());
          max = tf_op.getMax();
          rewriter.eraseOp(id2);
        }
        if (!matchPattern(min, m_Constant(&min_value))) return failure();
        if (!matchPattern(max, m_Constant(&max_value))) return failure();
    
        int quant_dim = -1;
        if (PerAxis) {
          // This is a special case that the quant_dim is the last dimensions
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/utils/fake_quant_utils.h

          min = min_id.getInput();
        }
        if (auto max_id = max.getDefiningOp<TF::IdentityOp>()) {
          max = max_id.getInput();
        }
    
        if (!matchPattern(min, m_Constant(&min_value))) {
          return false;
        }
        if (!matchPattern(max, m_Constant(&max_value))) {
          return false;
        }
        return true;  // Successfully matched and fetched.
      }
    };
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/reduce.h

        if (!matchPattern(reduce_op.getInitValues().front(),
                          m_Constant(&operand_init)))
          return failure();
        if (!IsValueInitValue(operand_init)) return failure();
    
        // Check that the iota init is zero.
        DenseElementsAttr iota_init;
        if (!matchPattern(reduce_op.getInitValues().back(), m_Constant(&iota_init)))
          return failure();
        if (iota_init.getValues<APInt>()[0] != 0) return failure();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/transforms/split_merged_operands.cc

        if (matchPattern(input_op, m_Constant(&attr))) {
          // Constant case.
          builder->setInsertionPoint(op);
          Operation* duplicated_input_op = builder->clone(*input_op);
    
          // Rewire the inputs.
          op->setOperand(index, duplicated_input_op->getResult(0));
        } else if (auto dq = dyn_cast<DequantizeOp>(input_op);
                   dq && matchPattern(dq.getInput(), m_Constant(&attr))) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/utils/fake_quant_utils.h

                      AttrType &max_value) const {
        Value min = tf_op.getMin(), max = tf_op.getMax();
        if (!matchPattern(min, m_Constant(&min_value))) {
          return false;
        }
        if (!matchPattern(max, m_Constant(&max_value))) {
          return false;
        }
        return true;  // Successfully matched and fetched.
      }
    };
    
    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/ir/tf_ops_tensor_helper.cc

    // routine uses the constant op's attribute to get the actual shape.
    RankedTensorType GetRankedTensorTypeForOperand(Value operand) {
      DenseElementsAttr attr;
      if (matchPattern(operand, m_Constant(&attr))) {
        return mlir::dyn_cast<RankedTensorType>(attr.getType());
      }
      return mlir::dyn_cast<RankedTensorType>(operand.getType());
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/ir/tf_arith_ops_folder.cc

      auto input_type = mlir::dyn_cast<RankedTensorType>(input.getType());
      if (!input_type) return success();
      int64_t rank = input_type.getRank();
    
      DenseIntElementsAttr dims_attr;
      if (!matchPattern(dims, m_Constant(&dims_attr))) return success();
      for (const auto &dim_pair : llvm::enumerate(dims_attr)) {
        int64_t cur_dim = dim_pair.value().getSExtValue();
        if (cur_dim < -rank || cur_dim >= rank)
          return emitError(loc)
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3K bytes
    - Viewed (0)
  10. 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)
Back to top