| 15 | class RoiPoolGrad : public OpGrad { |
| 16 | public: |
| 17 | virtual std::vector<Express::VARP> onGrad(Express::EXPRP expr, const std::vector<Express::VARP>& backwardOutput) override { |
| 18 | std::vector<Express::VARP> res(1, nullptr); |
| 19 | auto input = expr->inputs()[0]; |
| 20 | auto roi = expr->inputs()[1]; |
| 21 | |
| 22 | std::unique_ptr<OpT> forwardOp(expr->get()->UnPack()); |
| 23 | auto param = forwardOp->main.AsRoiParameters(); |
| 24 | int pooledHeight = param->pooledHeight; |
| 25 | int pooledWidth = param->pooledWidth; |
| 26 | auto spatialScale = param->spatialScale; |
| 27 | |
| 28 | res[0] = _ROIPooling(input, roi, pooledHeight, pooledWidth, spatialScale, true, _Convert(backwardOutput[0], NC4HW4)); |
| 29 | res[0] = _Convert(res[0], input->getInfo()->order); |
| 30 | |
| 31 | return res; |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | static void _create() { |
nothing calls this directly
no test coverage detected