MCPcopy Create free account
hub / github.com/davisking/dlib / scale_rows2

Function scale_rows2

dlib/cuda/tensor_tools.cpp:159–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

backward_inplaceMethod · 0.85

Calls 7

have_same_dimensionsFunction · 0.70
is_vectorFunction · 0.70
matFunction · 0.70
scale_rowsFunction · 0.70
ifFunction · 0.50
sizeMethod · 0.45
num_samplesMethod · 0.45

Tested by

no test coverage detected