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

Method set_sample

dlib/cuda/tensor.h:166–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165 template <typename EXP>
166 void set_sample (
167 unsigned long long idx,
168 const matrix_exp<EXP>& item
169 )
170 {
171 DLIB_CASSERT(idx < (unsigned long long)num_samples());
172 DLIB_CASSERT(item.size() == nr()*nc()*k());
173 static_assert((is_same_type<float, typename EXP::type>::value == true),
174 "To assign a matrix to a tensor the matrix must contain float values");
175 set_ptrm(host()+idx*item.size(), item.nr(), item.nc()) = item;
176 }
177
178
179 template <typename EXP>

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