Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 140 for getElementDtype (0.21 sec)

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

    #include "tsl/platform/statusor.h"
    
    namespace mlir {
    namespace TFL {
    
    absl::StatusOr<TypedAttr> CreateTypedAttr(ShapedType shaped_type, int value) {
      Type element_type = shaped_type.getElementType();
      if (element_type.isF16()) {
        auto floatType = mlir::FloatType::getF16(element_type.getContext());
        auto floatAttr = mlir::FloatAttr::get(floatType, static_cast<float>(value));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/reduce_type_precision.cc

        auto const_type = mlir::dyn_cast<ShapedType>(op.getOperand(0).getType());
        auto result_type = mlir::dyn_cast<ShapedType>(op.getResult().getType());
        if (!const_type || !const_type.getElementType().isSignlessInteger(4) ||
            !result_type || !result_type.getElementType().isSignlessInteger(8)) {
          return failure();
        }
    
        auto input_op =
            dyn_cast<arith::ConstantOp>(op.getOperand(0).getDefiningOp());
        if (!input_op) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/transforms/dense_to_sparse.cc

      int num_elements = type.getNumElements();
      int num_zeros = 0;
    
      if (mlir::isa<FloatType>(type.getElementType())) {
        for (const auto val : attr.getValues<APFloat>()) {
          if (val.isZero()) {
            num_zeros++;
          }
        }
      } else if (mlir::isa<quant::QuantizedType>(type.getElementType())) {
        for (const auto val : attr.getValues<int8_t>()) {
          if (val == 0) {
            num_zeros++;
          }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 16.1K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/uniform_quantized_stablehlo_to_tfl_pass.cc

          return failure();
        }
    
        if (!IsI8F32UniformQuantizedPerAxisType(filter_type.getElementType())) {
          LLVM_DEBUG(llvm::dbgs() << "Expected a per-channel uniform quantized "
                                     "(i8->f32) type filter. Got: "
                                  << filter_type.getElementType() << "\n");
          return failure();
        }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 09:00:19 UTC 2024
    - 99.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/unroll_batch_matmul.cc

      // Skip int8 x int8 => int32.
      if (lhs_type.getElementType().isInteger(8) &&
          rhs_type.getElementType().isInteger(8)) {
        return rewriter.notifyMatchFailure(op,
                                           "skip unrolling for int8 BatchMatMulV3");
      }
    
      auto element_type = lhs_type.getElementType();
    
      if (element_type != rhs_type.getElementType()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/constant_fold.cc

          // Ignore types with undefined bit widths.
          if (!tensor_type.getElementType().isIntOrFloat()) continue;
          if (!tensor_type.hasStaticShape()) {
            has_unknown_shape = true;
            return size;
          }
          size += tensor_type.getNumElements() *
                  tensor_type.getElementType().getIntOrFloatBitWidth();
        }
        return size;
      };
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/optimize.cc

        if (dot.getLhs().getType().getElementType() !=
                first_dot.getLhs().getType().getElementType() ||
            dot.getRhs().getType().getElementType() !=
                first_dot.getRhs().getType().getElementType() ||
            dot.getType().getElementType() != first_dot.getType().getElementType())
          return rewriter.notifyMatchFailure(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 26.9K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo.cc

        if (!keys_ty || !keys_ty.hasStaticShape() ||
            !keys_ty.getElementType().isIntOrFloat())
          return rewriter.notifyMatchFailure(
              op,
              "only match for the case where the first operand has a static "
              "int/float shapeType");
        if (!indices_ty || !indices_ty.hasStaticShape() ||
            !indices_ty.getElementType().isInteger(32))
          return rewriter.notifyMatchFailure(
              op,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 154.9K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/dot_general.cc

            RankedTensorType::get(lhs_flattened_shape, lhs_type.getElementType()),
            lhs_transposed.getResult());
      } else {
        auto lhs_flattend_shape_op = BuildDotOperandFlattenedShapeOp(
            lhs, lhs_dot_dimensions_info, builder, /*is_lhs=*/true);
        lhs_flattend = rewriter.create<mhlo::DynamicReshapeOp>(
            loc,
            RankedTensorType::get(lhs_flattened_shape, lhs_type.getElementType()),
            lhs_transposed, lhs_flattend_shape_op);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/utils/validators.h

      if (!tensorType) return false;
      return tensorType.getElementType().isF32();
    }
    
    // Returns true iff the given value is a bf16 tensor.
    inline bool TFTypeIsBFloat16Tensor(Value value) {
      auto tensorType = mlir::dyn_cast<TensorType>(value.getType());
      if (!tensorType) return false;
      return tensorType.getElementType().isBF16();
    }
    
    // Returns true iff the given value is a f16 tensor.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.7K bytes
    - Viewed (0)
Back to top