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

Method _run_cell

tensorflow/python/keras/layers/recurrent_test.py:1197–1208  ·  view source on GitHub ↗
(cell_fn, **kwargs)

Source from the content-addressed store, hash-verified

1195 def test_peephole_lstm_cell(self):
1196
1197 def _run_cell(cell_fn, **kwargs):
1198 inputs = array_ops.one_hot([1, 2, 3, 4], 4)
1199 cell = cell_fn(5, **kwargs)
1200 cell.build(inputs.shape)
1201 initial_state = cell.get_initial_state(
1202 inputs=inputs, batch_size=4, dtype=dtypes.float32)
1203 inputs, _ = cell(inputs, initial_state)
1204 output = inputs
1205 if not context.executing_eagerly():
1206 self.evaluate(variables_lib.global_variables_initializer())
1207 output = self.evaluate(output)
1208 return output
1209
1210 random_seed.set_random_seed(12345)
1211 # `recurrent_activation` kwarg is set to sigmoid as that is hardcoded into

Callers

nothing calls this directly

Calls 4

executing_eagerlyMethod · 0.80
buildMethod · 0.65
get_initial_stateMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected