{DataType::FP32, DataType::FP16},
{DataType::S32, DataType::FP16},
{DataType::FP16, DataType::S32},
+ {DataType::S32, DataType::U8},
};
} // namespace
std::vector<PrecisionPair> precisionsIO = {
{Precision::U8, Precision::FP16},
{Precision::FP32, Precision::FP16},
- {Precision::FP16, Precision::FP32}
+ {Precision::FP16, Precision::FP32},
+ {Precision::I32, Precision::U8}
};
std::vector<Precision> withFP16Precisions = {
} else if (srcPrecision == Precision::I32 && dstPrecision == Precision::FP16) {
dst->buffer().as<ie_fp16 *>()[i] = PrecisionUtils::f32tof16(
static_cast<float >(src->cbuffer().as<int32_t *>()[i]));
+ } else if (srcPrecision == Precision::I32 && dstPrecision == Precision::U8) {
+ dst->buffer().as<uint8_t *>()[i] = static_cast<uint8_t>(src->cbuffer().as<int32_t *>()[i]);
} else {
THROW_IE_EXCEPTION << "Unsupported input or output precision";
}
fp32_ptr = blob->buffer().as<float*>();
} else if (precision == Precision::I32) {
i32_ptr = blob->buffer().as<int32_t*>();
+ } else if (precision == Precision::U8) {
+ u8_ptr = blob->buffer().as<uint8_t*>();
} else {
THROW_IE_EXCEPTION << "Unsupported precision for compare: " << precision;
}
return PrecisionUtils::f16tof32(fp16_ptr[index]);
} else if (precision == Precision::I32) {
return i32_ptr[index];
+ } else if (precision == Precision::U8) {
+ return u8_ptr[index];
}
return fp32_ptr[index];
}
fp16_ptr[index] = PrecisionUtils::f32tof16(value);
} else if (precision == Precision::I32) {
i32_ptr[index] = value;
- }
- else {
+ } else if (precision == Precision::U8) {
+ u8_ptr[index] = value;
+ } else {
fp32_ptr[index] = value;
}
}
InferenceEngine::ie_fp16 *fp16_ptr;
float *fp32_ptr;
int32_t *i32_ptr;
+ uint8_t *u8_ptr;
public:
explicit BufferWrapper(const InferenceEngine::Blob::Ptr &blob);