Skip to content

Commit ddf8eb6

Browse files
authored
Fix compiler warnings on unhandled bfloat16 switch case (#1470)
/Users/travis/build/onnx/onnx/onnx/common/ir_pb_converter.cc:20:10: warning: enumeration value 'TensorProto_DataType_BFLOAT16' not handled in switch [-Wswitch]
1 parent cb0858d commit ddf8eb6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

onnx/common/ir_pb_converter.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Tensor tensorProtoToTensor(const ONNX_NAMESPACE::TensorProto & tp) {
2727
break;
2828
}
2929
case ONNX_NAMESPACE::TensorProto_DataType_FLOAT16:
30+
case ONNX_NAMESPACE::TensorProto_DataType_BFLOAT16:
3031
case ONNX_NAMESPACE::TensorProto_DataType_BOOL:
3132
case ONNX_NAMESPACE::TensorProto_DataType_INT8:
3233
case ONNX_NAMESPACE::TensorProto_DataType_INT16:
@@ -355,6 +356,7 @@ void encodeTensor(ONNX_NAMESPACE::TensorProto * p, const Tensor & tensor) {
355356
break;
356357
}
357358
case ONNX_NAMESPACE::TensorProto_DataType_FLOAT16:
359+
case ONNX_NAMESPACE::TensorProto_DataType_BFLOAT16:
358360
case ONNX_NAMESPACE::TensorProto_DataType_BOOL:
359361
case ONNX_NAMESPACE::TensorProto_DataType_INT8:
360362
case ONNX_NAMESPACE::TensorProto_DataType_INT16:

0 commit comments

Comments
 (0)