Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 30 for constant_ops (0.21 sec)

  1. tensorflow/compiler/mlir/quantization/stablehlo/passes/merge_fusion_with_dequantize.cc

            req_op.getLoc(), func_op.getResultTypes()[0], req_op.getOperand());
        if (func_name.contains("_relu6_")) {
          auto min = rewriter.create<mlir::stablehlo::ConstantOp>(
              req_op.getLoc(), rewriter.getF32FloatAttr(0));
          auto max = rewriter.create<mlir::stablehlo::ConstantOp>(
              req_op.getLoc(), rewriter.getF32FloatAttr(6));
          new_result = rewriter.create<mlir::stablehlo::ClampOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/transforms/outline_composites.cc

      auto one_cst =
          rewriter.create<stablehlo::ConstantOp>(rewriter.getUnknownLoc(), one_val);
    
      auto half_val = DenseElementsAttr::get(type, kHalf);
      auto half_cst =
          rewriter.create<stablehlo::ConstantOp>(one_cst.getLoc(), half_val);
    
      auto one_over_root2_val = DenseElementsAttr::get(type, kOneOverRoot2);
      auto one_over_root2_cst = rewriter.create<stablehlo::ConstantOp>(
          half_cst.getLoc(), one_over_root2_val);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/fold_constant_transpose.cc

      LogicalResult match(mlir::stablehlo::TransposeOp op) const override {
        Value operand = op.getOperand();
        auto const_op =
            dyn_cast_or_null<mlir::stablehlo::ConstantOp>(operand.getDefiningOp());
        if (!const_op) return failure();
    
        // Only support float tensors.
        auto tensor_type = mlir::dyn_cast_or_null<TensorType>(const_op.getType());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/experimental/tac/common/utils.h

    namespace TFL {
    namespace tac {
    
    // Returns true if 'op' is non const op. Returns false otherwise or if
    // 'op' is null.
    inline bool IsNonConstOp(Operation* op) {
      if (!op) return false;
      if (llvm::isa<arith::ConstantOp, mlir::func::ConstantOp>(op)) return false;
      if (op->hasTrait<OpTrait::ConstantLike>()) return false;
      if (llvm::isa<TFL::ConstOp, TFL::QConstOp>(op)) return false;
      return true;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/quantization/lite/tfl_to_std.cc

          q.erase();
        } else if (auto q = llvm::dyn_cast<ConstOp>(op)) {
          auto value = q.getValue();
          auto type = q.getResult().getType();
          if (arith::ConstantOp::isBuildableWith(value, type)) {
            auto c = b.create<arith::ConstantOp>(q.getLoc(), q.getValue());
            q.getOutput().replaceAllUsesWith(c);
            q.erase();
          } else if (TFL::NoValueOp::isBuildableWith(value, type)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 02:50:01 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/tflite_legalize_hlo.cc

      PopulateLegalizeHloToTFLitePatterns(&patterns, &context);
    
      ConversionTarget target(context);
      target.addLegalDialect<TFL::TensorFlowLiteDialect, mhlo::MhloDialect>();
      target.addLegalOp<func::CallOp, func::ConstantOp, arith::ConstantOp>();
      target.addDynamicallyLegalOp<mhlo::CustomCallOp>(IsCustomCallLegal);
      target.addDynamicallyLegalOp<mhlo::ReduceOp>(IsReduceOpLegal);
      // Converted MHLO ops should be marked illegal here.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/transforms/shlo_simplify.td

    def CloneF32ElementsAttrWithOnes
      : NativeCodeCall<"DenseElementsAttr::get($0.getType().cast<ShapedType>(), (float)1.0)">;
    
    def NotConstant : Constraint<
        CPred<"$0.isa<BlockArgument>() || !llvm::isa<stablehlo::ConstantOp>($0.getDefiningOp())">,
        "Is not a constant.">;
    
    def : Pat<(StableHLO_DivOp $l,
                (StableHLO_ConstantOp:$divisor FloatElementsAttr<32>:$cst)),
              (StableHLO_MulOp $l,
                (StableHLO_DivOp
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 10 03:05:20 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/ops/stablehlo_op_quant_spec.cc

        scale_spec->has_same_operand_and_result_type_requirement = true;
      }
      return scale_spec;
    }
    
    bool IsOpQuantizableStableHlo(Operation* op) {
      if (isa<func::ConstantOp, mlir::stablehlo::ConstantOp>(op)) {
        // Constant ops do not have QuantizableResult attribute but can be
        // quantized.
        return true;
      } else if (op->hasTrait<OpTrait::IsTerminator>() ||
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 05:56:10 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/stablehlo/passes/convert_func_to_bfloat16.cc

          if (failed(rewriter.convertRegionTypes(&new_region, *getTypeConverter())))
            return failure();
        }
    
        // Convert value of ConstantOp to bfloat16.
        if (auto const_op = dyn_cast<mlir::stablehlo::ConstantOp>(op)) {
          const auto values = const_op.getValue().tryGetValues<float>();
          if (!values.has_value()) {
            return failure();
          }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/quantization/ir/ConvertConst.cc

      // original const and the qbarrier that led to the quantization.
      auto fusedLoc = rewriter.getFusedLoc(
          {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();
    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