Why is SnapshotSolverState a protected function in solver.hpp?

4 views
Skip to first unread message

Kent Gauen

unread,
Jan 17, 2018, 4:47:45 PM1/17/18
to Caffe Users
I am working on a research project. I am exposing the SnapshotSolverState function to the python api so I can handle snapshots within my python code. I add " .def("save", &Solver<Dtype>::SnapshotSolverState)" to the CAFFE_ROOT/python/caffe/_caffe.cpp file. It works great, but I had to move the SnapshotSolverState function from protected to public in the CAFFE_ROOT/include/caffe/solvers.hpp file.

Why was it protected in the first place? I am looking for a "coding-practice" reason, hopefully beyond the simple responses. Of course, if the answer is simple then that's okay.

Examples of simple responses:
-> "It is good to protect functions."
-> "There was no need to expose the function to public"

Hopefully, there is a more complete answer than these.

Thank you.
Reply all
Reply to author
Forward
0 new messages