MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _create_slots

Method _create_slots

tensorflow/python/training/adam.py:122–136  ·  view source on GitHub ↗
(self, var_list)

Source from the content-addressed store, hash-verified

120 self._get_non_slot_variable("beta2_power", graph=graph))
121
122 def _create_slots(self, var_list):
123 # Create the beta1 and beta2 accumulators on the same device as the first
124 # variable. Sort the var_list to make sure this device is consistent across
125 # workers (these need to go on the same PS, otherwise some updates are
126 # silently ignored).
127 first_var = min(var_list, key=lambda x: x.name)
128 self._create_non_slot_variable(
129 initial_value=self._beta1, name="beta1_power", colocate_with=first_var)
130 self._create_non_slot_variable(
131 initial_value=self._beta2, name="beta2_power", colocate_with=first_var)
132
133 # Create slots for the first and second moments.
134 for v in var_list:
135 self._zeros_slot(v, "m", self._name, slot_config=slot_creator.SlotConfig(slot_index=1, slot_num=2))
136 self._zeros_slot(v, "v", self._name, slot_config=slot_creator.SlotConfig(slot_index=2, slot_num=2))
137
138 def _prepare(self):
139 lr = self._call_if_callable(self._lr)

Callers

nothing calls this directly

Calls 3

_zeros_slotMethod · 0.80
minFunction · 0.50

Tested by

no test coverage detected