cppflow
cppflow copied to clipboard
Support for bool datatype
tensor::get_data<bool>() call fails. Because internally it calls deduce_tf_type(), but here for bool type TF_BOOL is never returned because of the preceding if block
template<typename T>
TF_DataType deduce_tf_type() {
// ...
// As std::is_same<unsigned char, uint8_t>::value is true this condition becomes true here.
if (std::is_same<T, uint8_t>::value)
return TF_UINT8;
// ...
// This if condition NEVER executes because of the condition above
if (std::is_same<T, unsigned char>::value)
return TF_BOOL;
// ...
Changing it to the following works for me (for inference),
if (std::is_same<T, bool>::value)
return TF_BOOL;
Thanks for looking into it.
Lack of support of bool datatype is something that has been around for a long type. Should take a look to this soon.
In #208 there is a proposed solution.