Typo in variable name: BETA --> self.BETA (#16666)
authorcclauss <cclauss@bluewin.ch>
Wed, 7 Feb 2018 06:54:21 +0000 (07:54 +0100)
committerGunhan Gulsoy <gunan@google.com>
Wed, 7 Feb 2018 06:54:21 +0000 (22:54 -0800)
__BETA__ is defined on line 118 as a class member so it can only be accessed via __self__ or via the __ElasticAverageOptimizer__.

flake8 testing of https://github.com/tensorflow/tensorflow

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./tensorflow/contrib/opt/python/training/elastic_average_optimizer.py:153:27: F821 undefined name 'BETA'
      self._moving_rate = BETA / communication_period / num_worker
                          ^
```

tensorflow/contrib/opt/python/training/elastic_average_optimizer.py

index 716ee9c..5763593 100644 (file)
@@ -150,7 +150,7 @@ class ElasticAverageOptimizer(optimizer.Optimizer):
     self._global_map = ea_custom_getter._global_map
 
     if moving_rate is None:
-      self._moving_rate = BETA / communication_period / num_worker
+      self._moving_rate = self.BETA / communication_period / num_worker
     else:
       self._moving_rate = moving_rate
     if rho is None: