| 78 | } |
| 79 | |
| 80 | void TestGradient(ReductionParameter_ReductionOp op, |
| 81 | float coeff = 1, int axis = 0) { |
| 82 | typedef typename TypeParam::Dtype Dtype; |
| 83 | LayerParameter layer_param; |
| 84 | ReductionParameter* reduction_param = layer_param.mutable_reduction_param(); |
| 85 | reduction_param->set_operation(op); |
| 86 | reduction_param->set_coeff(coeff); |
| 87 | reduction_param->set_axis(axis); |
| 88 | ReductionLayer<Dtype> layer(layer_param); |
| 89 | GradientChecker<Dtype> checker(1e-2, 2e-3); |
| 90 | checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_, |
| 91 | this->blob_top_vec_); |
| 92 | } |
| 93 | |
| 94 | Blob<Dtype>* const blob_bottom_; |
| 95 | Blob<Dtype>* const blob_top_; |
no test coverage detected