MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / scatter_sub

Method scatter_sub

include/base/memory.h:232–241  ·  view source on GitHub ↗

Scatter data to a pool by substraction, according to an index mapping */

Source from the content-addressed store, hash-verified

230
231 /** Scatter data to a pool by substraction, according to an index mapping */
232 void scatter_sub(std::vector<Data> &memory, const std::vector<Index> &mapping) {
233 if (!mapping.empty()) {
234 for (Index i = 0; i < count; i++)
235 memory[mapping[i]] -= host_ptr[i];
236 }
237 else {
238 for (Index i = 0; i < count; i++)
239 memory[i] -= host_ptr[i];
240 }
241 }
242
243 /**
244 * @param capacity number of data

Callers 1

write_embeddingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected