| 297 | REGISTER_GRADIENT_OP("MaxPool3D", MaxPool3DGradHelper); |
| 298 | |
| 299 | Status AvgPoolGradHelper(const Scope& scope, const Operation& op, |
| 300 | const std::vector<Output>& grad_inputs, |
| 301 | std::vector<Output>* grad_outputs) { |
| 302 | std::vector<int32> ksize; |
| 303 | std::vector<int32> strides; |
| 304 | string padding; |
| 305 | string data_format; |
| 306 | auto attrs = op.output(0).node()->attrs(); |
| 307 | TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "ksize", &ksize)); |
| 308 | TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "strides", &strides)); |
| 309 | TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "padding", &padding)); |
| 310 | TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "data_format", &data_format)); |
| 311 | internal::AvgPoolGrad::Attrs grad_attrs; |
| 312 | auto dx = internal::AvgPoolGrad(scope, Shape(scope, op.input(0)), |
| 313 | grad_inputs[0], ksize, strides, padding, |
| 314 | grad_attrs.DataFormat(data_format)); |
| 315 | grad_outputs->push_back(dx); |
| 316 | return scope.status(); |
| 317 | } |
| 318 | REGISTER_GRADIENT_OP("AvgPool", AvgPoolGradHelper); |
| 319 | |
| 320 | Status AvgPool3DGradHelper(const Scope& scope, const Operation& op, |
nothing calls this directly
no test coverage detected