// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "bench_util.h" #include #include std::vector BenchArgsVector(benchmark::State& state, size_t& start, size_t count) { std::vector shape; shape.reserve(count); for (size_t axis = 0; axis < count; ++axis) { shape.emplace_back(state.range(start + axis)); } start += count; return shape; } std::vector RandomVectorUniform(std::vector shape, float min_value, float max_value) { int64_t sz = std::accumulate(shape.begin(), shape.end(), 1LL, std::multiplies()); if (sz <= 0) { throw std::invalid_argument("shape gives size must greater than 0!"); } return RandomVectorUniform(static_cast(sz), min_value, max_value); }