mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
[VITISAI] add float16 and bfloat16 support (#17438)
### Description Add float16 and bfloat16 data type support for VitisAI ep ### Motivation and Context The VitisAI ep has added the bfloat datatype support. So we would like to register the datatype from onnxruntime side to enable them. --------- Signed-off-by: Yiming Hu <yiming.hu@amd.com>
This commit is contained in:
parent
6b7bce5ec9
commit
1bc215e1d1
2 changed files with 6 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
VitsAI Execution Prividers
|
||||
VitisAI Execution Provider
|
||||
============================
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,9 +34,12 @@ static void xir_shape_infer(ONNX_NAMESPACE::InferenceContext& ctx) {
|
|||
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::INT64);
|
||||
} else if (data_type->s() == "int1") {
|
||||
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::BOOL);
|
||||
} else if (data_type->s() == "bfloat16") {
|
||||
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::BFLOAT16);
|
||||
} else if (data_type->s() == "float16") {
|
||||
updateOutputElemType(ctx, 0, ONNX_NAMESPACE::TensorProto::FLOAT16);
|
||||
} else {
|
||||
std::cerr << "not supported data_type " << data_type->s();
|
||||
abort();
|
||||
vai_assert(false, ", not supported data_type: " + data_type->s());
|
||||
}
|
||||
if (shape != nullptr) {
|
||||
for (auto i = 0; i < shape->ints_size(); ++i) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue