From 5843c0cd7b926f7956ed30bd161b04bf05b5c3de Mon Sep 17 00:00:00 2001 From: Smit Hinsu Date: Tue, 14 Apr 2020 21:25:58 -0700 Subject: [PATCH] Remove incorrect handling of PrimitiveType::F16 in CreateDenseElementsAttrFromLiteral PrimitiveType::F16 maps to Eigen::half and interpreting it as float will fail. This incorrect handling is removed for now and later on this type along with bf16 and complex types can be supported by constructing appropriate ElementsAttr. PiperOrigin-RevId: 306574537 Change-Id: Icbd87b24cdc60656ac62de5a7829340f94594a9d --- tensorflow/compiler/mlir/xla/hlo_utils.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tensorflow/compiler/mlir/xla/hlo_utils.cc b/tensorflow/compiler/mlir/xla/hlo_utils.cc index dfed190ba1e..962e18b297b 100644 --- a/tensorflow/compiler/mlir/xla/hlo_utils.cc +++ b/tensorflow/compiler/mlir/xla/hlo_utils.cc @@ -83,12 +83,11 @@ StatusOr CreateDenseElementsAttrFromLiteral( ConvertTensorShapeToType( literal.shape(), builder)); + // TODO(hinsu): Support remaining XLA primitive types. auto element_type = literal.shape().element_type(); switch (element_type) { case PrimitiveType::PRED: return CreateDenseAttrFromLiteral(type, literal); - case PrimitiveType::F16: - return CreateDenseAttrFromLiteral(type, literal); case PrimitiveType::F32: return CreateDenseAttrFromLiteral(type, literal); case PrimitiveType::F64: