diff --git a/lite/kernels/arm/cast_compute.cc b/lite/kernels/arm/cast_compute.cc index 4be34df0fb7acb69977393fff1d6e3ee930e5dcd..81416e4ddda8221a8d825a21d27b3e9067452e6a 100644 --- a/lite/kernels/arm/cast_compute.cc +++ b/lite/kernels/arm/cast_compute.cc @@ -83,6 +83,11 @@ void CastCompute::Run() { int64_t* out_data = param.Out->mutable_data(); std::transform( x_data_begin, x_data_end, out_data, TransOp); + } else if (param.in_dtype == 5 && param.out_dtype == 20) { // FP32 -> UINT8 + const float* x_data_begin = param.X->data(); + const float* x_data_end = x_data_begin + param.X->numel(); + uint8_t* out_data = param.Out->mutable_data(); + std::transform(x_data_begin, x_data_end, out_data, TransOp); } else { LOG(FATAL) << "other has not been implemented transform with dtype" << param.in_dtype << " X, dtype" << param.out_dtype << " Out";