Support bf16 in Builder::getZeroAttr

PiperOrigin-RevId: 266863802
This commit is contained in:
Smit Hinsu 2019-09-02 23:43:36 -07:00 committed by A. Unique TensorFlower
parent 2acd0dbf05
commit da646505c5
1 changed files with 2 additions and 3 deletions

View File

@ -253,12 +253,11 @@ ArrayAttr Builder::getAffineMapArrayAttr(ArrayRef<AffineMap> values) {
Attribute Builder::getZeroAttr(Type type) {
switch (type.getKind()) {
case StandardTypes::BF16:
case StandardTypes::F16:
return getF16FloatAttr(0);
case StandardTypes::F32:
return getF32FloatAttr(0);
case StandardTypes::F64:
return getF64FloatAttr(0);
return getFloatAttr(type, 0.0);
case StandardTypes::Integer: {
auto width = type.cast<IntegerType>().getWidth();
if (width == 1)