| 127 | } |
| 128 | |
| 129 | void scale_rows2 ( |
| 130 | float beta, |
| 131 | tensor& out, |
| 132 | const tensor& m1, |
| 133 | const tensor& m2, |
| 134 | const tensor& v1, |
| 135 | const tensor& v2 |
| 136 | ) |
| 137 | { |
| 138 | DLIB_CASSERT(have_same_dimensions(out,m1)); |
| 139 | DLIB_CASSERT(have_same_dimensions(out,m2)); |
| 140 | DLIB_CASSERT(have_same_dimensions(v1,v2)); |
| 141 | DLIB_CASSERT(is_vector(mat(v1))); |
| 142 | DLIB_CASSERT(static_cast<long long>(v1.size()) == m1.num_samples()); |
| 143 | |
| 144 | #ifdef DLIB_USE_CUDA |
| 145 | cuda::scale_rows2(beta, out, m1, m2, v1, v2); |
| 146 | #else |
| 147 | if (beta == 0) |
| 148 | out = scale_rows(mat(m1) - scale_rows(mat(m2),mat(v1)), mat(v2)); |
| 149 | else |
| 150 | out = beta*mat(out) + scale_rows(mat(m1) - scale_rows(mat(m2),mat(v1)), mat(v2)); |
| 151 | #endif |
| 152 | } |
| 153 | |
| 154 | // ---------------------------------------------------------------------------------------- |
| 155 |
no test coverage detected