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

Method _zeros_slot

tensorflow/python/training/optimizer.py:1337–1356  ·  view source on GitHub ↗

Find or create a slot initialized with 0.0. Args: var: A `Variable` object. slot_name: Name for the slot. op_name: Name to use when scoping the Variable that needs to be created for the slot. Returns: A `Variable` object.

(self, var, slot_name, op_name, slot_config=None)

Source from the content-addressed store, hash-verified

1335 return named_slots[_var_key(var)]
1336
1337 def _zeros_slot(self, var, slot_name, op_name, slot_config=None):
1338 """Find or create a slot initialized with 0.0.
1339
1340 Args:
1341 var: A `Variable` object.
1342 slot_name: Name for the slot.
1343 op_name: Name to use when scoping the Variable that
1344 needs to be created for the slot.
1345
1346 Returns:
1347 A `Variable` object.
1348 """
1349 named_slots = self._slot_dict(slot_name)
1350 if _var_key(var) not in named_slots:
1351 new_slot_variable = slot_creator.create_zeros_slot(var, op_name, slot_config=slot_config)
1352 self._restore_slot_variable(
1353 slot_name=slot_name, variable=var,
1354 slot_variable=new_slot_variable)
1355 named_slots[_var_key(var)] = new_slot_variable
1356 return named_slots[_var_key(var)]
1357
1358 # --------------
1359 # For implementing the Trackable interface.

Callers 12

_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80
_create_slotsMethod · 0.80

Calls 3

_slot_dictMethod · 0.95
_var_keyFunction · 0.70

Tested by

no test coverage detected