Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for isBF16 (0.1 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/passes/cast_bf16_ops_to_f32.cc

          return failure();
        }
        for (Value input : op->getOperands()) {
          if (getElementTypeOrSelf(input).isBF16()) {
            return success();
          }
        }
        for (Value value : op->getResults()) {
          if (getElementTypeOrSelf(value).isBF16()) {
            return success();
          }
        }
        return failure();
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sun Dec 10 05:52:02 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/utils/constant_utils.cc

      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));
        std::vector<Attribute> floatValues({floatAttr});
        return DenseElementsAttr::get(shaped_type, floatValues);
      } else if (element_type.isBF16()) {
        auto floatType = mlir::FloatType::getBF16(element_type.getContext());
    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/tensorflow/utils/convert_type.cc

      }
    }
    
    Status ConvertScalarTypeToDataType(Type type, DataType* dtype) {
      if (type.isF16()) {
        *dtype = DT_HALF;
        return absl::OkStatus();
      } else if (type.isF32()) {
        *dtype = DT_FLOAT;
        return absl::OkStatus();
      } else if (type.isF64()) {
        *dtype = DT_DOUBLE;
        return absl::OkStatus();
      } else if (type.isBF16()) {
        *dtype = DT_BFLOAT16;
        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)
  4. tensorflow/compiler/mlir/lite/utils/validators.h

      if (!tensorType) return false;
      return tensorType.getElementType().isBF16();
    }
    
    // Returns true iff the given value is a f16 tensor.
    inline bool TFTypeIsHalfTensor(Value value) {
      auto tensorType = mlir::dyn_cast<TensorType>(value.getType());
      if (!tensorType) return false;
      return tensorType.getElementType().isF16();
    }
    
    // Returns true iff the given value is a f16 or bf16 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)
  5. tensorflow/compiler/mlir/lite/utils/convert_type.cc

    namespace tflite {
    
    using absl::StatusOr;
    
    namespace errors = tensorflow::errors;
    
    tflite::TensorType ConvertTypeToTensorType(mlir::Type type) {
      if (type.isF16()) {
        return tflite::TensorType_FLOAT16;
      } else if (type.isBF16()) {
        return tflite::TensorType_BFLOAT16;
      } else if (type.isF32()) {
        return tflite::TensorType_FLOAT32;
      } else if (type.isF64()) {
        return tflite::TensorType_FLOAT64;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 07 23:04:40 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/tensorflow/ops/tf_op_quant_spec.cc

      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(
        const tensorflow::quantization::QuantizationOptions& quantization_options) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints.td

    def IsF32ElementType : Constraint<
      CPred<"getElementTypeOrSelf($0).isF32()">>;
    
    // Checks if the value has the type of bfloat16.
    def IsBF16ElementType : Constraint<
      CPred<"getElementTypeOrSelf($0).isBF16()">>;
    
    // Checks if the value has the type of UniformQuantizedType.
    def IsUniformQuantizedType : Constraint<
      CPred<"getElementTypeOrSelf($0).isa<mlir::quant::UniformQuantizedType>()">>;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 08 04:55:44 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/tensorflow/ops/tf_quantize_op.cc

          loc, scale_type,
          DenseFPElementsAttr::get(scale_type,
                                   {static_cast<float>(qtype.getScale())}));
    
      if (original_input_tensor_type.getElementType().isBF16()) {
        // Add bf16 cast op after scale to match with the next op's data
        // type.
        scale_op = rewriter.create<TF::CastOp>(
            loc, UnrankedTensorType::get(rewriter.getBF16Type()), scale_op);
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/while_loop_outline.cc

    }
    
    bool IsCompatibleTypeWithTFLCastOp(Type type) {
      auto elemType = getElementTypeOrSelf(type);
      // F16, F32, F64, BF16 types are allowed.
      if (elemType.isBF16() || elemType.isF16() || elemType.isF32() ||
          elemType.isF64())
        return true;
    
      // I1, I4, I8, I16, I32, I64 types are allowed.
      if (elemType.isInteger(1) || elemType.isInteger(4) || elemType.isInteger(8) ||
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tf2xla/internal/passes/xla_broadcast.cc

      Type type = val_bcast.getType();
      Type elem_type = getElementTypeOrSelf(type);
      // Xla's all_reduce legalizer bitcasts to 32 bits, so only
      // element types size <= 4 bytes are supported.
      if (elem_type.isBF16() || elem_type.isF16() || elem_type.isTF32() ||
          elem_type.isF32()) {
        zero = builder.getFloatAttr(elem_type, 0);
      } else {
        return false;
      }
      if (auto ranked_type = dyn_cast<RankedTensorType>(type)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jun 13 18:52:07 UTC 2024
    - 13.9K bytes
    - Viewed (0)
Back to top