| 107 | } |
| 108 | |
| 109 | void scale_rows ( |
| 110 | tensor& out, |
| 111 | const tensor& m, |
| 112 | const tensor& v |
| 113 | ) |
| 114 | { |
| 115 | DLIB_CASSERT(have_same_dimensions(out,m)); |
| 116 | DLIB_CASSERT(is_vector(v)); |
| 117 | if (m.size() == 0 && v.size() == 0) |
| 118 | return; |
| 119 | DLIB_CASSERT(m.size() != 0); |
| 120 | DLIB_CASSERT(m.num_samples() == static_cast<long long>(v.size())); |
| 121 | |
| 122 | #ifdef DLIB_USE_CUDA |
| 123 | cuda::scale_rows(out, m, v); |
| 124 | #else |
| 125 | out = scale_rows(mat(m), mat(v)); |
| 126 | #endif |
| 127 | } |
| 128 | |
| 129 | void scale_rows2 ( |
| 130 | float beta, |