提交 867de3e1 编写于 作者: Z zhaojiaying01

fix annotation of unit test of net

上级 1cce6c25
......@@ -34,7 +34,7 @@ int main() {
std::vector<float> input;
std::vector<int64_t> dims{1, 3, 224, 224};
GetInput<float>(g_test_image_1x3x224x224, &input, dims);
// 预热
// 预热
for (int i = 0; i < 10; ++i) {
auto vec_result = paddle_mobile.Predict(input, dims);
}
......
......@@ -32,7 +32,7 @@ int main() {
std::vector<int64_t> dims{1, 3, 300, 300};
GetInput<float>(g_hand, &input, dims);
// 预热
// 预热
for (int i = 0; i < 10; ++i) {
auto output = paddle_mobile.Predict(input, dims);
}
......
......@@ -32,13 +32,13 @@ int main() {
std::vector<int64_t> dims{1, 3, 224, 224};
GetInput<float>(g_test_image_1x3x224x224_banana, &input, dims);
// 预热一次
auto vec_result = paddle_mobile.Predict(input, dims);
std::vector<float>::iterator biggest =
std::max_element(std::begin(vec_result), std::end(vec_result));
std::cout << " Max element is " << *biggest << " at position "
<< std::distance(std::begin(vec_result), biggest) << std::endl;
// 预热十次
for (int i = 0; i < 10; ++i) {
auto vec_result = paddle_mobile.Predict(input, dims);
}
......
......@@ -29,13 +29,16 @@ int main() {
std::vector<int64_t> dims{1, 3, 224, 224};
GetInput<float>(g_test_image_1x3x224x224_banana, &input, dims);
// 预热一次
auto vec_result = paddle_mobile.Predict(input, dims);
std::vector<float>::iterator biggest =
std::max_element(std::begin(vec_result), std::end(vec_result));
std::cout << " Max element is " << *biggest << " at position "
<< std::distance(std::begin(vec_result), biggest) << std::endl;
// 预热十次
for (int i = 0; i < 10; ++i) {
auto vec_result = paddle_mobile.Predict(input, dims);
}
auto time3 = time();
for (int i = 0; i < 10; ++i) {
auto vec_result = paddle_mobile.Predict(input, dims);
......
......@@ -36,8 +36,10 @@ int main() {
std::vector<float> input(input_tensor.data<float>(),
input_tensor.data<float>() + input_tensor.numel());
// 预热一次
paddle_mobile.Predict(input, dims);
// 预热十次
for (int i = 0; i < 10; ++i) {
paddle_mobile.Predict(input, dims);
}
auto time3 = time();
for (int i = 0; i < 10; ++i) {
paddle_mobile.Predict(input, dims);
......
......@@ -32,7 +32,7 @@ int main() {
std::vector<float> input(input_tensor.data<float>(),
input_tensor.data<float>() + input_tensor.numel());
// 预热
// 预热
for (int i = 0; i < 10; ++i) {
paddle_mobile.Predict(input, dims);
}
......
......@@ -33,7 +33,7 @@ int main() {
std::vector<float> input(input_tensor.data<float>(),
input_tensor.data<float>() + input_tensor.numel());
// 预热
// 预热
for (int i = 0; i < 10; ++i) {
paddle_mobile.Predict(input, dims);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册