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

Method get_slot

tensorflow/contrib/optimizer_v2/optimizer_v2.py:1019–1037  ·  view source on GitHub ↗

Return a slot named `name` created for `var` by the Optimizer. Some `Optimizer` subclasses use additional variables. For example `Momentum` and `Adagrad` use variables to accumulate updates. This method gives access to these `Variable` objects if for some reason you need them. Us

(self, var, name)

Source from the content-addressed store, hash-verified

1017 return apply_updates
1018
1019 def get_slot(self, var, name):
1020 """Return a slot named `name` created for `var` by the Optimizer.
1021
1022 Some `Optimizer` subclasses use additional variables. For example
1023 `Momentum` and `Adagrad` use variables to accumulate updates. This method
1024 gives access to these `Variable` objects if for some reason you need them.
1025
1026 Use `get_slot_names()` to get the list of slot names created by the
1027 `Optimizer`.
1028
1029 Args:
1030 var: A variable passed to `minimize()` or `apply_gradients()`.
1031 name: A string.
1032
1033 Returns:
1034 The `Variable` for the slot if it was created, `None` otherwise.
1035 """
1036 state = self._get_state_for_var(var)
1037 return state.get_slot(var, name) if state is not None else None
1038
1039 def get_slot_names(self):
1040 """Return a list of the names of slots created by the `Optimizer`.

Callers 15

testBasicMethod · 0.45
doTestBasicMethod · 0.45
_apply_denseMethod · 0.45
_resource_apply_denseMethod · 0.45
_apply_sparseMethod · 0.45
testSaveRestoreMethod · 0.45
_initialized_modelMethod · 0.45
_set_sentinelsMethod · 0.45

Calls 1

_get_state_for_varMethod · 0.95

Tested by 15

testBasicMethod · 0.36
doTestBasicMethod · 0.36
testSaveRestoreMethod · 0.36
_initialized_modelMethod · 0.36
_set_sentinelsMethod · 0.36
_check_sentinelsMethod · 0.36
doTestBasicMethod · 0.36
doTestBasicMethod · 0.36