INNER CODE UNIT · Python
variables
horovod/horovod · horovod/_keras/__init__.py:84
def variables(self):
return CallableList(super(self.__class__, self).variables())
else:
def variables(self):
if _IS_TF2:
return super(self.__class__, self).variables()
return self.get_weights()
def register_local_var(self, var):
"""Registers a source/variable as worker local. Horovod will not perform any global
operations on gradients corresponding to these sources and will instead return the local
gradient."""
if self._agg_helper:
self._agg_helper.register_local_var(var)
elif _IS_TF2:
self._local_vars.add(var.ref())
else:
self._local_vars.add(var)