Skip to content

Commit

Permalink
move some missing net->read after setting optimize field
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed Aug 22, 2019
1 parent fcddeb4 commit a71711e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/net_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ TEST(net, bireal18imagenet_comparison) {
std::shared_ptr<bnn::Mat> blob1, blob2;
{
auto net = bnn::Net::create();
net->read("/data/local/tmp/model_imagenet.dab");
net->optimize = false;
net->read("/data/local/tmp/model_imagenet.dab");
net->run(input);
blob1 = net->get_blob(blob_name);
}
{
auto net = bnn::Net::create();
net->read("/data/local/tmp/model_imagenet.dab");
net->optimize = true;
net->read("/data/local/tmp/model_imagenet.dab");
net->run(input);
blob2 = net->get_blob(blob_name);
}
Expand All @@ -56,8 +56,8 @@ TEST(net, bireal18imagenet) {
const std::string blob_name = "188";
{
auto net = bnn::Net::create();
net->read("/data/local/tmp/model_imagenet.dab");
net->optimize = true;
net->read("/data/local/tmp/model_imagenet.dab");
net->run(input);
const auto blob = net->get_blob(blob_name);
ASSERT_NEAR((*blob)[0], -0.9431, 1e-4);
Expand Down Expand Up @@ -96,8 +96,8 @@ TEST(net, bireal18imagenetstem) {
const std::string blob_name = "216";
{
auto net = bnn::Net::create();
net->read("/data/local/tmp/model_imagenet_stem.dab");
net->optimize = true;
net->read("/data/local/tmp/model_imagenet_stem.dab");
net->run(input);
const auto &blob = net->get_blob(blob_name);
ASSERT_NEAR((*blob)[0], 1.9842, 1e-4);
Expand Down

0 comments on commit a71711e

Please sign in to comment.