| 63 | |
| 64 | template <typename T> |
| 65 | auto make_model(lbann::lbann_comm& comm, int class_n) |
| 66 | { |
| 67 | lbann_data::LbannPB my_proto; |
| 68 | if (!pb::TextFormat::ParseFromString(model_prototext, &my_proto)) |
| 69 | throw "Parsing protobuf failed."; |
| 70 | // Construct a trainer so that the model can register the input layer |
| 71 | auto& trainer = |
| 72 | lbann::construct_trainer(&comm, my_proto.mutable_trainer(), my_proto); |
| 73 | unit_test::utilities::mock_data_reader(trainer, {1, 1, class_n}, class_n); |
| 74 | auto my_model = lbann::proto::construct_model(&comm, |
| 75 | my_proto.optimizer(), |
| 76 | my_proto.trainer(), |
| 77 | my_proto.model()); |
| 78 | my_model->setup(class_n, {&comm.get_trainer_grid()}); |
| 79 | return my_model; |
| 80 | } |
| 81 | |
| 82 | } // namespace |
| 83 |
nothing calls this directly
no test coverage detected