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

Function scale_rows2

dlib/cuda/tensor_tools.cpp:129–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

backward_inplaceMethod · 0.85

Calls 6

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

Tested by

no test coverage detected