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

Function lstm_model_fn

tensorflow/python/ops/parallel_for/gradients_test.py:73–83  ·  view source on GitHub ↗
(batch_size, state_size, steps, inputs_size=None)

Source from the content-addressed store, hash-verified

71
72
73def lstm_model_fn(batch_size, state_size, steps, inputs_size=None):
74 inputs_size = inputs_size or state_size
75 inputs = [
76 random_ops.random_normal([batch_size, inputs_size]) for _ in range(steps)
77 ]
78 cell = rnn_cell.BasicLSTMCell(state_size)
79 init_state = cell.zero_state(batch_size, dtypes.float32)
80 state = init_state
81 for inp in inputs:
82 _, state = cell(inp, state)
83 return init_state.c, state.c
84
85
86def dynamic_lstm_model_fn(batch_size, state_size, max_steps):

Callers 3

create_lstm_hessianFunction · 0.85

Calls 3

rangeFunction · 0.50
random_normalMethod · 0.45
zero_stateMethod · 0.45

Tested by

no test coverage detected