| 178 | |
| 179 | template <typename EXP> |
| 180 | void add_to_sample ( |
| 181 | unsigned long long idx, |
| 182 | const matrix_exp<EXP>& item |
| 183 | ) |
| 184 | { |
| 185 | DLIB_CASSERT(idx < (unsigned long long)num_samples()); |
| 186 | DLIB_CASSERT(item.size() == nr()*nc()*k()); |
| 187 | static_assert((is_same_type<float, typename EXP::type>::value == true), |
| 188 | "To assign a matrix to a tensor the matrix must contain float values"); |
| 189 | set_ptrm(host()+idx*item.size(), item.nr(), item.nc()) += item; |
| 190 | } |
| 191 | |
| 192 | |
| 193 | #ifdef DLIB_USE_CUDA |
no test coverage detected