aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/cc/framework/gradients.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/cc/framework/gradients.cc')
-rw-r--r--tensorflow/cc/framework/gradients.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/cc/framework/gradients.cc b/tensorflow/cc/framework/gradients.cc
index cec3ebc0ad..66a943410e 100644
--- a/tensorflow/cc/framework/gradients.cc
+++ b/tensorflow/cc/framework/gradients.cc
@@ -356,7 +356,7 @@ Status SymbolicGradientBuilder::AddGradients() {
// Check if any input nodes still have pending gradients and have not been
// processed yet. This happens if not all outputs of a node are in 'inputs_'.
std::unordered_map<Node*, int> requested_grads;
- for (Output nout : inputs_) {
+ for (const Output& nout : inputs_) {
if (pending_[nout.node()->id()] > 0) {
DCHECK_GT(nout.node()->num_outputs(), 1);
int idx = input_nodes_[nout];
@@ -365,7 +365,7 @@ Status SymbolicGradientBuilder::AddGradients() {
++requested_grads[nout.node()];
}
}
- for (auto& p : requested_grads) {
+ for (const auto& p : requested_grads) {
int num_requested_inputs = p.first->num_outputs() - pending_[p.first->id()];
CHECK_EQ(num_requested_inputs, p.second);
}