| 222 | |
| 223 | template <typename T> |
| 224 | std::vector<T> MakeRandomTensor(const armnn::TensorInfo& tensorInfo, |
| 225 | unsigned int seed, |
| 226 | float min = -10.0f, |
| 227 | float max = 10.0f) |
| 228 | { |
| 229 | std::mt19937 gen(seed); |
| 230 | std::uniform_real_distribution<float> dist(min, max); |
| 231 | |
| 232 | std::vector<float> init(tensorInfo.GetNumElements()); |
| 233 | for (unsigned int i = 0; i < init.size(); i++) |
| 234 | { |
| 235 | init[i] = dist(gen); |
| 236 | } |
| 237 | |
| 238 | const float qScale = tensorInfo.GetQuantizationScale(); |
| 239 | const int32_t qOffset = tensorInfo.GetQuantizationOffset(); |
| 240 | |
| 241 | return armnnUtils::QuantizedVector<T>(init, qScale, qOffset); |
| 242 | } |
nothing calls this directly
no test coverage detected