assert(tfl_interp_view.shape() == nnapi_view.shape());
- uint8_t value = 0;
+ auto fp = static_cast<uint8_t (RandomGenerator::*)(const ::nnfw::util::tensor::Shape &,
+ const ::nnfw::util::tensor::Index &)>(
+ &RandomGenerator::generate<uint8_t>);
+ const nnfw::util::tensor::Object<uint8_t> data(tfl_interp_view.shape(),
+ std::bind(fp, _randgen, _1, _2));
+ assert(tfl_interp_view.shape() == data.shape());
nnfw::util::tensor::iterate(tfl_interp_view.shape())
<< [&](const nnfw::util::tensor::Index &ind) {
- // TODO Generate random values
- value = (value + 1) & 0xFF;
+ const auto value = data.at(ind);
tfl_interp_view.at(ind) = value;
nnapi_view.at(ind) = value;