(time_, cell_output, cell_state, unused_loop_state)
| 2072 | cell = rnn_cell.LSTMCell(num_units, state_is_tuple=True) |
| 2073 | |
| 2074 | def loop_fn(time_, cell_output, cell_state, unused_loop_state): |
| 2075 | emit_output = cell_output # == None for time == 0 |
| 2076 | if cell_output is None: # time == 0 |
| 2077 | next_state = cell.zero_state(batch_size, dtypes.float32) |
| 2078 | else: |
| 2079 | next_state = cell_state # copy state through |
| 2080 | elements_finished = (time_ >= sequence_length) |
| 2081 | finished = math_ops.reduce_all(elements_finished) |
| 2082 | # For the very final iteration, we must emit a dummy input |
| 2083 | next_input = control_flow_ops.cond( |
| 2084 | finished, |
| 2085 | lambda: array_ops.zeros([batch_size, input_depth], dtype=dtypes.float32), |
| 2086 | lambda: inputs_ta.read(time_)) |
| 2087 | return (elements_finished, next_input, next_state, emit_output, None) |
| 2088 | |
| 2089 | reuse_scope = variable_scope.get_variable_scope() |
| 2090 |
nothing calls this directly
no test coverage detected