| 157 | } |
| 158 | |
| 159 | void scale_rows2 ( |
| 160 | float beta, |
| 161 | tensor& out, |
| 162 | const tensor& m1, |
| 163 | const tensor& m2, |
| 164 | const tensor& v1, |
| 165 | const tensor& v2 |
| 166 | ) |
| 167 | { |
| 168 | DLIB_CASSERT(have_same_dimensions(out,m1)); |
| 169 | DLIB_CASSERT(have_same_dimensions(out,m2)); |
| 170 | DLIB_CASSERT(have_same_dimensions(v1,v2)); |
| 171 | DLIB_CASSERT(is_vector(mat(v1))); |
| 172 | DLIB_CASSERT(static_cast<long long>(v1.size()) == m1.num_samples()); |
| 173 | |
| 174 | IF_DLIB_USE_CUDA( |
| 175 | cuda::scale_rows2(beta, out, m1, m2, v1, v2); |
| 176 | ) |
| 177 | |
| 178 | IF_DLIB_NOT_USE_CUDA( |
| 179 | if (beta == 0) |
| 180 | out = scale_rows(mat(m1) - scale_rows(mat(m2),mat(v1)), mat(v2)); |
| 181 | else |
| 182 | out = beta*mat(out) + scale_rows(mat(m1) - scale_rows(mat(m2),mat(v1)), mat(v2)); |
| 183 | ) |
| 184 | } |
| 185 | |
| 186 | // ---------------------------------------------------------------------------------------- |
| 187 |
no test coverage detected