提交 5843c0cd 编写于 作者: S Smit Hinsu 提交者: TensorFlower Gardener

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
上级 2f65c246
......@@ -83,12 +83,11 @@ StatusOr<mlir::DenseElementsAttr> CreateDenseElementsAttrFromLiteral(
ConvertTensorShapeToType<mlir::RankedTensorType>(
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<bool>(type, literal);
case PrimitiveType::F16:
return CreateDenseAttrFromLiteral<float>(type, literal);
case PrimitiveType::F32:
return CreateDenseAttrFromLiteral<float>(type, literal);
case PrimitiveType::F64:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册