| 269 | |
| 270 | template<typename Dtype> |
| 271 | void P2PSync<Dtype>::InternalThreadEntry() { |
| 272 | Caffe::SetDevice(solver_->param().device_id()); |
| 273 | CHECK(Caffe::root_solver()); |
| 274 | Caffe::set_root_solver(false); |
| 275 | // See if there is a defined seed and reset random state if so |
| 276 | if (solver_->param().random_seed() >= 0) { |
| 277 | // Fetch random seed and modulate by device ID to make sure |
| 278 | // everyone doesn't have the same seed. We seem to have some |
| 279 | // solver instability if we have everyone with the same seed |
| 280 | Caffe::set_random_seed( |
| 281 | solver_->param().random_seed() + solver_->param().device_id()); |
| 282 | } |
| 283 | solver_->Step(solver_->param().max_iter() - initial_iter_); |
| 284 | } |
| 285 | |
| 286 | template<typename Dtype> |
| 287 | void P2PSync<Dtype>::on_start() { |
nothing calls this directly
no test coverage detected