mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
use const auto& as type for grad alias (#63949)
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
This commit is contained in:
parent
5757d03145
commit
61d88cdd1c
|
|
@ -479,7 +479,7 @@ def process_function(info: DifferentiabilityInfo, template: CodeTemplate) -> str
|
||||||
body: List[str] = []
|
body: List[str] = []
|
||||||
|
|
||||||
if uses_single_grad(info):
|
if uses_single_grad(info):
|
||||||
body.append('auto& grad = grads[0];')
|
body.append('const auto& grad = grads[0];')
|
||||||
|
|
||||||
def emit_derivative(
|
def emit_derivative(
|
||||||
derivative: Derivative,
|
derivative: Derivative,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user