Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for ConstantOp (0.14 sec)

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

          // Create new ConstantOp-ConvertOp-Operation sequences. At this moment,
          // old ConstantOp is guaranteed to have one F32->F16 convert op regardless
          // of its number of users.
          rewriter.setInsertionPointAfter(op);
          // create new F16 constant op in that location
          ConstantOp new_const = rewriter.create<ConstantOp>(
              op->getLoc(), new_result_type, new_value_attr);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_dynamic_range.cc

            changed = true;
          }
        }
        return changed;
      }
    
      // Convert ConstantOp-CastOp-Operation sequence into new ConstantOp
      // -Dequantize-Operation where the new ConstantOp has float16 data type.
      bool convertToFloat16Constant(PatternRewriter& rewriter,
                                    arith::ConstantOp op) const {
        for (auto connected_op : op.getResult().getUsers()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 20.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_quantize_drq.cc

    class PrepareDRQQuantizableOp : public OpRewritePattern<arith::ConstantOp> {
     public:
      explicit PrepareDRQQuantizableOp(MLIRContext* context,
                                       const quant::QuantizationSpecs& quant_specs,
                                       OpSet op_set,
                                       bool enable_per_channel_quantization)
          : OpRewritePattern<arith::ConstantOp>(context),
            quant_specs_(quant_specs),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/fold_broadcast_pass.cc

    template <typename Op, typename ElementType = Type, typename ValType,
              typename Convert>
    static Attribute BinaryFolder(Op *op) {
      auto lhs_op = op->getLhs().template getDefiningOp<mhlo::ConstantOp>();
      auto rhs_op = op->getRhs().template getDefiningOp<mhlo::ConstantOp>();
      if (!lhs_op || !lhs_op) return {};
    
      auto lhs = dyn_cast_or_null<DenseElementsAttr>(lhs_op.getValue());
      auto rhs = dyn_cast_or_null<DenseElementsAttr>(rhs_op.getValue());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver.cc

        }
      });
    }
    
    arith::ConstantOp QuantizationDriver::DuplicateConstantOpIfNeeded(
        arith::ConstantOp op, Operation* target_op, const int operand_index) {
      if (op.getResult().hasOneUse()) {
        return op;
      }
      OpBuilder builder(op->getContext());
      builder.setInsertionPointAfter(op);
      arith::ConstantOp new_op = cast<arith::ConstantOp>(builder.clone(*op));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 38.1K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/transforms/push_transpose_through_ewise.cc

            llvm::isa<BlockArgument>(tpose_arg2.getPerm())) {
          return failure();
        }
        auto perm1 = llvm::dyn_cast_or_null<arith::ConstantOp>(
            tpose_arg1.getPerm().getDefiningOp());
        auto perm2 = llvm::dyn_cast_or_null<arith::ConstantOp>(
            tpose_arg2.getPerm().getDefiningOp());
        if (!perm1 || !perm2) {
          return failure();
        }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tfr/ir/tfr_ops.cc

                                               Type type, Location loc) {
      if (arith::ConstantOp::isBuildableWith(value, type))
        return builder.create<arith::ConstantOp>(loc, type,
                                                 value.cast<TypedAttr>());
      if (func::ConstantOp::isBuildableWith(value, type))
        return builder.create<func::ConstantOp>(loc, type,
                                                value.cast<FlatSymbolRefAttr>());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Nov 21 16:55:41 UTC 2023
    - 38.2K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints_test.cc

    #include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
    #include "tsl/platform/status_matchers.h"
    
    namespace mlir::quant {
    namespace {
    
    using ::mlir::stablehlo::AddOp;
    using ::mlir::stablehlo::ConstantOp;
    using ::mlir::stablehlo::ConvolutionOp;
    using ::mlir::stablehlo::DotGeneralOp;
    using ::mlir::stablehlo::SubtractOp;
    using ::testing::ElementsAreArray;
    using ::testing::Eq;
    using ::testing::IsEmpty;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 14 17:10:32 UTC 2024
    - 22.9K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/einsum.cc

      auto constant_attr = rewriter->getI32TensorAttr(values);
      return rewriter->create<arith::ConstantOp>(loc, values_type, constant_attr);
    }
    
    // Creates ConstantOp for array of int64_t.
    arith::ConstantOp createI64ConstantOp(llvm::ArrayRef<int64_t> values,
                                          Location loc, PatternRewriter* rewriter) {
      auto values_type = RankedTensorType::get(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 33.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/utils/lstm_utils.cc

      return builder->create<arith::ConstantOp>(location, type, attr);
    }
    
    Value CreateF32SplatConst(OpBuilder* builder, ArrayRef<int64_t> shape,
                              float val, mlir::Location location) {
      auto type = RankedTensorType::get(shape, builder->getF32Type());
      auto attr = DenseElementsAttr::get(type, val);
      return builder->create<arith::ConstantOp>(location, type, attr);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 36.2K bytes
    - Viewed (0)
Back to top