Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 52 for getElementDtype (0.38 sec)

  1. tensorflow/compiler/mlir/lite/transforms/unfold_large_splat_constant.cc

        auto splat_elements_attr =
            mlir::dyn_cast<SplatElementsAttr>(const_op.getValue());
        if (!splat_elements_attr) {
          return;
        }
        auto element_type = splat_elements_attr.getType().getElementType();
        if (!(element_type.isF32() || element_type.isF16() ||
              element_type.isInteger(1) || element_type.isInteger(32) ||
              element_type.isInteger(64))) {
          return;
        }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/utils/perception_ops_utils.cc

          func_.getFunctionType().getInput(0));
      if (!image_type || !image_type.getElementType().isF32() ||
          image_type.getRank() != 4) {
        return func_.emitWarning() << "Image should be a 4D float tensor";
      }
    
      auto flow_type = mlir::dyn_cast_or_null<RankedTensorType>(
          func_.getFunctionType().getInput(1));
      if (!flow_type || !flow_type.getElementType().isF32() ||
          flow_type.getRank() != 4) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/common/uniform_quantized_types.h

    bool IsExpressedTypeF32(QuantizedType quantized_type);
    
    // Given a value, extract the `ElementType`.
    // `value` should be a non-null `TensorType`.
    inline Type GetElementType(const Value value) {
      return mlir::cast<TensorType>(value.getType()).getElementType();
    }
    
    // Returns true iff `type` is a uniform quantized type whose storage type is
    // 8-bit integer and expressed type is f32.
    bool IsI8F32UniformQuantizedType(Type type);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/reduce.h

        Value iota = reduce_op.getInputs().back();
        if (!MatchIota(reduce_op.getDimensions(), iota)) return failure();
    
        // Match the reduction computation.
        const bool is_float = mlir::isa<FloatType>(operand_init.getElementType());
        if (failed(MatchReduceToArgMinMaxType1(reduce_op, is_float, is_argmax)) &&
            failed(MatchReduceToArgMinMaxType2(reduce_op, is_argmax)))
          return rewriter.notifyMatchFailure(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/stablehlo/transforms/tflite_legalize_hlo.cc

     public:
      using ConvertReduceOpToArgMinMax::ConvertReduceOpToArgMinMax;
    
      bool IsValueInitValue(const DenseElementsAttr& attr) const override {
        auto element_type = attr.getType().getElementType();
        if (attr.getNumElements() != 1 || !element_type.isIntOrFloat())
          return false;
        if (mlir::isa<FloatType>(element_type)) {
          auto value = *attr.value_begin<APFloat>();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/tensorflow/utils/tf_quantize_op_utils.cc

    UnrankedTensorType CreateUnknownShapeFromElementType(Type tensor_type) {
      if (!mlir::cast<TensorType>(tensor_type)) return UnrankedTensorType();
      return UnrankedTensorType::get(
          mlir::cast<TensorType>(tensor_type).getElementType());
    }
    
    }  // namespace quant
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/tensorflow/ops/tf_op_quant_spec.cc

    }
    
    bool IsValueWithQuantizablePrecision(Value val) {
      auto type = mlir::dyn_cast<ShapedType>(val.getType());
      if (!type) return false;
      // Supported original tensor data types.
      if (type.getElementType().isF32() || type.getElementType().isBF16())
        return true;
      return false;
    }
    
    std::optional<tensorflow::quantization::QuantizationComponentSpec>
    GetWeightComponentSpec(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/utils/bfloat16_type.cc

      return isa<FloatType>(type) && type.getIntOrFloatBitWidth() > 16;
    }
    
    Type ToBfloat16Type(Type type) {
      if (auto shaped = mlir::dyn_cast<ShapedType>(type)) {
        const Type elem = shaped.getElementType();
        if (IsLargeFloatType(elem)) {
          return shaped.clone(BFloat16Type::get(type.getContext()));
        }
      } else if (IsLargeFloatType(type)) {
        return BFloat16Type::get(type.getContext());
      }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/experimental/tac/transforms/fold_constants_to_subgraph.cc

        // arith ConstOp path.
        auto type =
            mlir::cast<ShapedType>(arith_const_op.getType()).getElementType();
        if (!type.isInteger(32) && !type.isInteger(64)) return false;
      } else if (auto const_op = dyn_cast_or_null<TFL::ConstOp>(op)) {
        // ConstOp path.
        auto type = mlir::cast<ShapedType>(const_op.getType()).getElementType();
        if (!type.isInteger(32) && !type.isInteger(64)) return false;
      } else {
        // QConstOp path.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/utils/convert_type.cc

                absl::StrCat("Converting ", debugString(type), " to DataType"));
        }
      } else if (auto complex_type = mlir::dyn_cast<mlir::ComplexType>(type)) {
        auto etype = complex_type.getElementType();
        if (etype.isF32()) {
          *dtype = DT_COMPLEX64;
          return absl::OkStatus();
        } else if (etype.isF64()) {
          *dtype = DT_COMPLEX128;
          return absl::OkStatus();
        }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 7.5K bytes
    - Viewed (0)
Back to top