| 225 | REGISTER_GRADIENT_OP("Reshape", ReshapeGrad); |
| 226 | |
| 227 | Status ExpandDimsGrad(const Scope& scope, const Operation& op, |
| 228 | const std::vector<Output>& grad_inputs, |
| 229 | std::vector<Output>* grad_outputs) { |
| 230 | auto input_shape = Shape(scope, op.input(0)); |
| 231 | grad_outputs->push_back(Reshape(scope, grad_inputs[0], input_shape)); |
| 232 | grad_outputs->push_back(NoGradient()); |
| 233 | return scope.status(); |
| 234 | } |
| 235 | REGISTER_GRADIENT_OP("ExpandDims", ExpandDimsGrad); |
| 236 | |
| 237 | Status SqueezeGrad(const Scope& scope, const Operation& op, |