Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63949
This is an extension of the discussion in
https://github.com/pytorch/pytorch/pull/63040#discussion_r687793027.
Test Plan: Imported from OSS
Reviewed By: albanD
Differential Revision:
D30546789
Pulled By: dagitses
fbshipit-source-id:
3046aff4f129d5492d73dfb67717a824e16ffee8
body: List[str] = []
if uses_single_grad(info):
- body.append('auto& grad = grads[0];')
+ body.append('const auto& grad = grads[0];')
def emit_derivative(
derivative: Derivative,