solver: check and set type to reconcile class and proto
authorEvan Shelhamer <shelhamer@imaginarynumber.net>
Mon, 21 Nov 2016 17:35:57 +0000 (09:35 -0800)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Mon, 21 Nov 2016 17:35:57 +0000 (09:35 -0800)
commite52451de914312b80a83459cb160c2f72a5b4fea
treebd258b09897ce8160c26aea7d912ca653944b08d
parent473f143f9422e7fc66e9590da6b2a1bb88e50b2f
solver: check and set type to reconcile class and proto

the solver checks its proto type (SolverParameter.type) on
instantiation:

- if the proto type is unspecified it's set according to the class type
  `Solver::type()`
- if the proto type and class type conflict, the solver dies loudly

this helps avoid accidental instantiation of a different solver type
than intended when the solver def and class differ. guaranteed type
information in the SolverParameter will simplify multi-solver
coordination too.
include/caffe/solver.hpp
src/caffe/solver.cpp
src/caffe/test/test_gradient_based_solver.cpp