| 232 | |
| 233 | template <typename T1, typename T2> |
| 234 | SimpleTensor<T1> copy_tensor(const SimpleTensor<T2> &tensor) |
| 235 | { |
| 236 | SimpleTensor<T1> st(tensor.shape(), tensor.data_type(), tensor.num_channels(), tensor.quantization_info(), |
| 237 | tensor.data_layout()); |
| 238 | for (size_t n = 0; n < size_t(st.num_elements()); n++) |
| 239 | { |
| 240 | st.data()[n] = static_cast<T1>(tensor.data()[n]); |
| 241 | } |
| 242 | return st; |
| 243 | } |
| 244 | |
| 245 | template <typename T1, typename T2, typename std::enable_if<std::is_same<T1, T2>::value, int>::type = 0> |
| 246 | SimpleTensor<T1> copy_tensor(const SimpleTensor<half> &tensor) |
nothing calls this directly
no test coverage detected