MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / AvgPoolGradHelper

Function AvgPoolGradHelper

tensorflow/cc/gradients/nn_grad.cc:299–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297REGISTER_GRADIENT_OP("MaxPool3D", MaxPool3DGradHelper);
298
299Status 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}
318REGISTER_GRADIENT_OP("AvgPool", AvgPoolGradHelper);
319
320Status AvgPool3DGradHelper(const Scope& scope, const Operation& op,

Callers

nothing calls this directly

Calls 9

outputMethod · 0.65
GetNodeAttrFunction · 0.50
AvgPoolGradFunction · 0.50
ShapeClass · 0.50
attrsMethod · 0.45
nodeMethod · 0.45
inputMethod · 0.45
push_backMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected