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

Function fill_tensor_vector

utils/Utils.h:768–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766
767template <typename T, typename TensorType>
768void fill_tensor_vector(TensorType &tensor, std::vector<T> vec)
769{
770 ARM_COMPUTE_ERROR_ON(tensor.info()->tensor_shape().total_size() != vec.size());
771
772 map(tensor, true);
773
774 Window window;
775 window.use_tensor_dimensions(tensor.info()->tensor_shape());
776
777 int i = 0;
778 Iterator it_tensor(&tensor, window);
779 execute_window_loop(
780 window, [&](const Coordinates &) { *reinterpret_cast<T *>(it_tensor.ptr()) = vec.at(i++); }, it_tensor);
781
782 unmap(tensor);
783}
784
785template <typename T, typename TensorType>
786void fill_random_tensor(TensorType &tensor,

Callers 1

do_setupMethod · 0.85

Calls 6

mapFunction · 0.85
unmapFunction · 0.85
total_sizeMethod · 0.45
infoMethod · 0.45
sizeMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected