| 135 | } |
| 136 | |
| 137 | void scale_rows ( |
| 138 | tensor& out, |
| 139 | const tensor& m, |
| 140 | const tensor& v |
| 141 | ) |
| 142 | { |
| 143 | DLIB_CASSERT(have_same_dimensions(out,m)); |
| 144 | DLIB_CASSERT(is_vector(v)); |
| 145 | if (m.size() == 0 && v.size() == 0) |
| 146 | return; |
| 147 | DLIB_CASSERT(m.size() != 0); |
| 148 | DLIB_CASSERT(m.num_samples() == static_cast<long long>(v.size())); |
| 149 | |
| 150 | IF_DLIB_USE_CUDA( |
| 151 | cuda::scale_rows(out, m, v); |
| 152 | ) |
| 153 | |
| 154 | IF_DLIB_NOT_USE_CUDA( |
| 155 | out = scale_rows(mat(m), mat(v)); |
| 156 | ) |
| 157 | } |
| 158 | |
| 159 | void scale_rows2 ( |
| 160 | float beta, |