forked from OSchip/llvm-project
Support bf16 in Builder::getZeroAttr
PiperOrigin-RevId: 266863802
This commit is contained in:
parent
2acd0dbf05
commit
da646505c5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue