SINGA-131 Implement and optimize hybrid training using both CPU and GPU update test files checked with cpplint
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/040cbb2e Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/040cbb2e Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/040cbb2e Branch: refs/heads/master Commit: 040cbb2e121164268284c4a8d005bd9aea83f40c Parents: a91e82f Author: WANG Sheng <[email protected]> Authored: Wed Apr 6 20:27:48 2016 +0800 Committer: WANG Sheng <[email protected]> Committed: Wed Apr 6 20:27:48 2016 +0800 ---------------------------------------------------------------------- src/neuralnet/input_layer/store.cc | 3 ++- src/test/test_csv_input_layer.cc | 2 +- src/test/test_gru_layer.cc | 4 ++-- src/test/test_record_input_layer.cc | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/040cbb2e/src/neuralnet/input_layer/store.cc ---------------------------------------------------------------------- diff --git a/src/neuralnet/input_layer/store.cc b/src/neuralnet/input_layer/store.cc index f213227..3b642ca 100644 --- a/src/neuralnet/input_layer/store.cc +++ b/src/neuralnet/input_layer/store.cc @@ -41,8 +41,9 @@ void StoreInputLayer::Setup(const LayerProto& conf, batchsize_ = batchsize.Get(0) / conf.num_partitions(); else // manual partition batchsize_ = batchsize.Get(conf.partition_id()); - } else + } else { batchsize_ = conf.store_conf().batchsize(0); + } } void StoreInputLayer::ComputeFeature(int flag, http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/040cbb2e/src/test/test_csv_input_layer.cc ---------------------------------------------------------------------- diff --git a/src/test/test_csv_input_layer.cc b/src/test/test_csv_input_layer.cc index 6613d87..86eaff9 100644 --- a/src/test/test_csv_input_layer.cc +++ b/src/test/test_csv_input_layer.cc @@ -38,7 +38,7 @@ class CSVInputLayerTest : public ::testing::Test { ofs.close(); auto conf = csv_conf.mutable_store_conf(); conf->set_path(path); - conf->set_batchsize(2); + conf->add_batchsize(2); conf->add_shape(3); conf->set_backend("textfile"); } http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/040cbb2e/src/test/test_gru_layer.cc ---------------------------------------------------------------------- diff --git a/src/test/test_gru_layer.cc b/src/test/test_gru_layer.cc index d7c8fe8..e0e381f 100644 --- a/src/test/test_gru_layer.cc +++ b/src/test/test_gru_layer.cc @@ -45,7 +45,7 @@ class GRULayerTest: public ::testing::Test { ofs1.close(); auto conf1 = in1_conf.mutable_store_conf(); conf1->set_path(path1); - conf1->set_batchsize(2); + conf1->add_batchsize(2); conf1->add_shape(4); conf1->set_backend("textfile"); conf1->set_has_label(false); @@ -61,7 +61,7 @@ class GRULayerTest: public ::testing::Test { auto conf2 = in2_conf.mutable_store_conf(); conf2->set_path(path2); - conf2->set_batchsize(2); + conf2->add_batchsize(2); conf2->add_shape(4); conf2->set_backend("textfile"); conf2->set_has_label(false); http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/040cbb2e/src/test/test_record_input_layer.cc ---------------------------------------------------------------------- diff --git a/src/test/test_record_input_layer.cc b/src/test/test_record_input_layer.cc index 9c953c1..64e1ad4 100644 --- a/src/test/test_record_input_layer.cc +++ b/src/test/test_record_input_layer.cc @@ -69,7 +69,7 @@ class RecordInputLayerTest : public ::testing::Test { auto conf = image_conf.mutable_store_conf(); conf->set_path(path); - conf->set_batchsize(2); + conf->add_batchsize(2); conf->add_shape(3); conf->set_backend("kvfile"); }
