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

Function MaxPoolGradHelper

tensorflow/cc/gradients/nn_grad.cc:240–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238REGISTER_GRADIENT_OP("Conv2D", Conv2DGrad);
239
240Status MaxPoolGradHelper(const Scope& scope, const Operation& op,
241 const std::vector<Output>& grad_inputs,
242 std::vector<Output>* grad_outputs) {
243 string data_format;
244 string padding;
245 std::vector<int32> strides;
246 std::vector<int32> ksize;
247 auto attrs = op.output(0).node()->attrs();
248 TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "data_format", &data_format));
249 TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "ksize", &ksize));
250 TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "padding", &padding));
251 TF_RETURN_IF_ERROR(GetNodeAttr(attrs, "strides", &strides));
252 auto dx = internal::MaxPoolGrad(
253 scope, op.input(0), op.output(0), grad_inputs[0], ksize, strides, padding,
254 internal::MaxPoolGrad::DataFormat(data_format));
255 grad_outputs->push_back(dx);
256 return scope.status();
257}
258REGISTER_GRADIENT_OP("MaxPool", MaxPoolGradHelper);
259
260Status MaxPoolGradV2Helper(const Scope& scope, const Operation& op,

Callers

nothing calls this directly

Calls 8

outputMethod · 0.65
GetNodeAttrFunction · 0.50
MaxPoolGradFunction · 0.50
attrsMethod · 0.45
nodeMethod · 0.45
inputMethod · 0.45
push_backMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected