diff options
Diffstat (limited to 'tests/AssetsLibrary.h')
-rw-r--r-- | tests/AssetsLibrary.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/AssetsLibrary.h b/tests/AssetsLibrary.h index ae88824298..4bbe4c56f6 100644 --- a/tests/AssetsLibrary.h +++ b/tests/AssetsLibrary.h @@ -352,6 +352,16 @@ public: template <typename T> void fill_layer_data(T &&tensor, std::string name) const; + /** Fill a tensor with a constant value + * + * @param[in, out] tensor To be filled tensor. + * @param[in] value Value to be assigned to all elements of the input tensor. + * + * @note @p value must be of the same type as the data type of @p tensor + */ + template <typename T, typename D> + void fill_tensor_value(T &&tensor, D value) const; + private: // Function prototype to convert between image formats. using Converter = void (*)(const RawTensor &src, RawTensor &dst); @@ -774,6 +784,12 @@ void AssetsLibrary::fill_layer_data(T &&tensor, std::string name) const }); } } + +template <typename T, typename D> +void AssetsLibrary::fill_tensor_value(T &&tensor, D value) const +{ + fill_tensor_uniform(tensor, 0, value, value); +} } // namespace test } // namespace arm_compute #endif /* __ARM_COMPUTE_TEST_TENSOR_LIBRARY_H__ */ |