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

Method add_to_sample

dlib/cuda/tensor.h:180–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178
179 template <typename EXP>
180 void add_to_sample (
181 unsigned long long idx,
182 const matrix_exp<EXP>& item
183 )
184 {
185 DLIB_CASSERT(idx < (unsigned long long)num_samples());
186 DLIB_CASSERT(item.size() == nr()*nc()*k());
187 static_assert((is_same_type<float, typename EXP::type>::value == true),
188 "To assign a matrix to a tensor the matrix must contain float values");
189 set_ptrm(host()+idx*item.size(), item.nr(), item.nc()) += item;
190 }
191
192
193#ifdef DLIB_USE_CUDA

Callers 1

operator()Method · 0.80

Calls 4

set_ptrmFunction · 0.85
sizeMethod · 0.45
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected