Commit 90c2f5bd authored by Geoffrey Wenger's avatar Geoffrey Wenger Committed by Scott Cyphers

Support for bf16 & f16 for test utility read_float_vector (#4181)

Co-authored-by: 's avatarScott Cyphers <diyessi@users.noreply.github.com>
parent 3665d85f
......@@ -643,6 +643,19 @@ vector<float> read_float_vector(shared_ptr<runtime::Tensor> tv)
float_vec.push_back(static_cast<float>(value));
}
}
else if (element_type == element::bf16)
{
vector<bfloat16> vec = read_vector<bfloat16>(tv);
float_vec = bfloat16::to_float_vector(vec);
}
else if (element_type == element::f16)
{
vector<float16> vec = read_vector<float16>(tv);
for (float16 value : vec)
{
float_vec.push_back(static_cast<float>(value));
}
}
else if (element_type == element::f32)
{
vector<float> vec = read_vector<float>(tv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment