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

Method _rnn_get_variable

tensorflow/python/ops/rnn_cell_impl.py:246–260  ·  view source on GitHub ↗
(self, getter, *args, **kwargs)

Source from the content-addressed store, hash-verified

244 return super(RNNCell, self).__call__(inputs, state)
245
246 def _rnn_get_variable(self, getter, *args, **kwargs):
247 variable = getter(*args, **kwargs)
248 if context.executing_eagerly():
249 trainable = variable._trainable # pylint: disable=protected-access
250 else:
251 trainable = (
252 variable in tf_variables.trainable_variables() or
253 (isinstance(variable, tf_variables.PartitionedVariable) and
254 list(variable)[0] in tf_variables.trainable_variables()))
255 if trainable and all(variable is not v for v in self._trainable_weights):
256 self._trainable_weights.append(variable)
257 elif not trainable and all(
258 variable is not v for v in self._non_trainable_weights):
259 self._non_trainable_weights.append(variable)
260 return variable
261
262 @property
263 def state_size(self):

Callers

nothing calls this directly

Calls 5

getterFunction · 0.85
allFunction · 0.85
executing_eagerlyMethod · 0.80
trainable_variablesMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected