MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / fill

Method fill

tests/AssetsLibrary.h:579–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577
578template <typename T, typename D>
579void AssetsLibrary::fill(std::vector<T> &vec, D &&distribution, std::random_device::result_type seed_offset) const
580{
581 ARM_COMPUTE_ERROR_ON_MSG(vec.empty(), "Vector must not be empty");
582
583 using ResultType = typename std::remove_reference<D>::type::result_type;
584
585 std::mt19937 gen(_seed + seed_offset);
586 for (size_t i = 0; i < vec.size(); ++i)
587 {
588 const ResultType value = distribution(gen);
589
590 vec[i] = value;
591 }
592}
593
594template <typename T, typename ResultType>
595void AssetsLibrary::fill_with_generator(T &&tensor, const GeneratorFunctionType<ResultType> &generate_value) const

Callers

nothing calls this directly

Calls 10

index2coordFunction · 0.85
fillFunction · 0.85
get_format_for_channelFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
element_sizeMethod · 0.45
dataMethod · 0.45
data_typeMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected