| 190 | // use-case. Given the line count, this was clearly the way to go... :/ |
| 191 | namespace { |
| 192 | struct AddToGrad |
| 193 | { |
| 194 | AddToGrad(optimizer& opt, EvalType scale_factor) |
| 195 | : opt_{&opt}, scale_{scale_factor} |
| 196 | {} |
| 197 | void DispatchError(El::BaseDistMatrix const&) |
| 198 | { |
| 199 | LBANN_ERROR("Unable to dispatch!"); |
| 200 | } |
| 201 | void DeductionError(El::BaseDistMatrix const&) |
| 202 | { |
| 203 | LBANN_ERROR("Unable to deduce type!"); |
| 204 | } |
| 205 | template <typename T> |
| 206 | void operator()(El::AbstractDistMatrix<T> const& contrib) |
| 207 | { |
| 208 | opt_->add_to_gradient(contrib, El::To<T>(scale_)); |
| 209 | } |
| 210 | optimizer* opt_; |
| 211 | EvalType scale_; |
| 212 | }; // struct AddToGrad |
| 213 | |
| 214 | using ValidDataTypes = h2::meta::TL< |
| 215 | #ifdef LBANN_HAS_GPU_FP16 |
no outgoing calls
no test coverage detected