| 57 | REGISTER_GRADIENT_OP("Pack", PackGrad); |
| 58 | |
| 59 | Status UnpackGrad(const Scope& scope, const Operation& op, |
| 60 | const std::vector<Output>& grad_inputs, |
| 61 | std::vector<Output>* grad_outputs) { |
| 62 | int axis; |
| 63 | TF_RETURN_IF_ERROR(GetNodeAttr(op.node()->attrs(), "axis", &axis)); |
| 64 | grad_outputs->push_back(Stack(scope, grad_inputs, Stack::Axis(axis))); |
| 65 | return scope.status(); |
| 66 | } |
| 67 | REGISTER_GRADIENT_OP("Unpack", UnpackGrad); |
| 68 | |
| 69 | Status IdentityGrad(const Scope& scope, const Operation& op, |