| 643 | |
| 644 | template <typename T, typename DataType> |
| 645 | void AssetsLibrary::fill_static_values(T &&tensor, const std::vector<DataType> &values) const |
| 646 | { |
| 647 | auto it = values.begin(); |
| 648 | GeneratorFunctionType<DataType> get_next_value = [&]() |
| 649 | { |
| 650 | const DataType value = *it; |
| 651 | ++it; |
| 652 | |
| 653 | if (it == values.end()) |
| 654 | { |
| 655 | it = values.begin(); |
| 656 | } |
| 657 | |
| 658 | return value; |
| 659 | }; |
| 660 | |
| 661 | fill_with_generator(tensor, get_next_value); |
| 662 | } |
| 663 | |
| 664 | template <typename D> |
| 665 | void AssetsLibrary::fill(RawTensor &raw, D &&distribution, std::random_device::result_type seed_offset) const |