Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for CreateConstOpWithSingleValue (0.41 sec)

  1. tensorflow/compiler/mlir/lite/utils/constant_utils.h

    #include "mlir/IR/PatternMatch.h"  // from @llvm-project
    #include "tsl/platform/statusor.h"
    
    namespace mlir {
    namespace TFL {
    
    // Returns a Constant op with a single value.
    absl::StatusOr<arith::ConstantOp> CreateConstOpWithSingleValue(
        PatternRewriter* rewriter, Location loc, ShapedType shaped_type, int value);
    
    // Returns a Constant op with a splat vector value.
    absl::StatusOr<arith::ConstantOp> CreateConstOpWithVectorValue(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Feb 27 06:24:28 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/utils/constant_utils.cc

      return rewriter->create<arith::ConstantOp>(loc, dense_type,
                                                 cast<TypedAttr>(*attr));
    }
    
    absl::StatusOr<arith::ConstantOp> CreateConstOpWithSingleValue(
        PatternRewriter* rewriter, Location loc, ShapedType shaped_type,
        int value) {
      ShapedType scalar_type =
          RankedTensorType::get({}, shaped_type.getElementType());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform_patterns.cc

        float val = 0.0;
        bias_attr = mlir::DenseFPElementsAttr::get(bias_type, val);
      } else {
        // TODO(renjieliu): Refactor this and share the logic with
        // CreateConstOpWithSingleValue. Also, make sure it works with QConst.
        return failure();
      }
    
      auto zero_bias = rewriter.create<TFL::ConstOp>(op->getLoc(), bias_attr);
      op->setOperand(bias_idx, zero_bias);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/transforms/prepare_tf.cc

        // Expanded inputs.
        // Insert at -2 location.
        auto one_ele_type =
            tensorflow::GetTypeFromTFTensorShape({1}, rewriter.getIntegerType(32));
        auto minus_two = CreateConstOpWithSingleValue(&rewriter, rfft_op.getLoc(),
                                                      one_ele_type, -2);
    
        SmallVector<int64_t, 4> expanded_input_shape;
        SmallVector<int64_t, 4> expanded_output_shape;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 21:49:50 UTC 2024
    - 64.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/transforms/optimize.cc

        }
    
        Value mul_rhs_value;
        if (!output_type.hasRank() || (output_type.getNumDynamicDims() > 0)) {
          auto status_or_const_op =
              CreateConstOpWithSingleValue(&rewriter, loc, input_type, 1);
          if (!status_or_const_op.ok()) {
            return failure();
          }
    
          mul_rhs_value = rewriter.create<TFL::FillOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 102.3K bytes
    - Viewed (0)
Back to top