MCPcopy Create free account
hub / github.com/alibaba/bigcomputing / _copy_some_through

Function _copy_some_through

DIEN/rnn.py:203–213  ·  view source on GitHub ↗
(flat_new_output, flat_new_state)

Source from the content-addressed store, hash-verified

201 return array_ops.where(copy_cond, output, new_output)
202
203 def _copy_some_through(flat_new_output, flat_new_state):
204 # Use broadcasting select to determine which values should get
205 # the previous state & zero output, and which values should get
206 # a calculated state & output.
207 flat_new_output = [
208 _copy_one_through(zero_output, new_output)
209 for zero_output, new_output in zip(flat_zero_output, flat_new_output)]
210 flat_new_state = [
211 _copy_one_through(state, new_state)
212 for state, new_state in zip(flat_state, flat_new_state)]
213 return flat_new_output + flat_new_state
214
215 def _maybe_copy_some_through():
216 """Run RNN step. Pass through either no or some past state."""

Callers 3

_maybe_copy_some_throughFunction · 0.85
_rnn_stepFunction · 0.85
bodyFunction · 0.85

Calls 1

_copy_one_throughFunction · 0.85

Tested by

no test coverage detected