| 279 | } |
| 280 | |
| 281 | void do_copy_diff_u8_q8(const TensorND& dst, const TensorND& src) { |
| 282 | auto isrc = tensor_iter_valonly<DTypeTrait<dtype::Uint8>::ctype>(src).begin(); |
| 283 | auto idst = tensor_iter_valonly<DTypeTrait<dtype::QuantizedS8>::ctype>(dst).begin(); |
| 284 | auto dst_dt_parm = dst.layout.dtype.param<dtype::QuantizedS8>(); |
| 285 | for (size_t i = 0, it = dst.layout.total_nr_elems(); i < it; ++i) { |
| 286 | *idst = dst_dt_parm.quantize((float)(*isrc) - 128.f); |
| 287 | ++idst; |
| 288 | ++isrc; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | void do_copy_diff_q4_q4(const TensorND& dst, const TensorND& src) { |
| 293 | auto isrc = tensor_iter_valonly<DTypeTrait<dtype::QuantizedS4>::ctype>(src).begin(); |
no test coverage detected