| 205 | REGISTER_OP_GRADIENT("MaxPool", MaxPoolGrad); |
| 206 | |
| 207 | Status AvgPoolGrad(const AttrSlice& attrs, FunctionDef* g) { |
| 208 | // clang-format off |
| 209 | *g = FDH::Define( |
| 210 | // Arg defs |
| 211 | {"input: T", "grad: T"}, |
| 212 | // Ret val defs |
| 213 | {"output: T"}, |
| 214 | // Attr defs |
| 215 | {"T: {float, half} = DT_FLOAT", |
| 216 | "ksize: list(int) >= 4", |
| 217 | "strides: list(int) >= 4", |
| 218 | GetPaddingAttrString()}, |
| 219 | // Nodes |
| 220 | { |
| 221 | {{"i_shape"}, "Shape", {"input"}, {{"T", "$T"}}}, |
| 222 | {{"output"}, "AvgPoolGrad", {"i_shape", "grad"}, |
| 223 | /*Attrs=*/{{"T", "$T"}, |
| 224 | {"ksize", "$ksize"}, |
| 225 | {"strides", "$strides"}, |
| 226 | {"padding", "$padding"}}} |
| 227 | }); |
| 228 | // clang-format on |
| 229 | return Status::OK(); |
| 230 | } |
| 231 | REGISTER_OP_GRADIENT("AvgPool", AvgPoolGrad); |
| 232 | |
| 233 | Status MaxPoolGradGrad(const AttrSlice& attrs, FunctionDef* g) { |
no test coverage detected