ce11b92597b32bccf9999e94550855e55e02da9b,sonnet/python/modules/basic_rnn.py,DeepRNN,_build,#DeepRNN#Any#Any#,312

Before Change



    if self._skip_connections and self._concat_final_output_if_skip:
      flat_outputs = tuple(nest.flatten(output) for output in outputs)
      flat_outputs = [tf.concat(output, 1) for output in zip(*flat_outputs)]
      output = nest.pack_sequence_as(structure=outputs[0],
                                     flat_sequence=flat_outputs)
    else:

After Change


    next_states = []
    outputs = []
    recurrent_idx = 0
    concatenate = lambda *args: tf.concat(args, axis=-1)
    for i, core in enumerate(self._cores):
      if self._skip_connections and i > 0:
        current_input = nest.map_structure(concatenate, inputs, current_input)

      // Determine if this core in the stack is recurrent or not and call
      // accordingly.
      if self._is_recurrent_list[i]:
        current_input, next_state = core(current_input,
                                         prev_state[recurrent_idx])
        next_states.append(next_state)
        recurrent_idx += 1
      else:
        current_input = core(current_input)

      if self._skip_connections:
        outputs.append(current_input)

    if self._skip_connections and self._concat_final_output_if_skip:
      output = nest.map_structure(concatenate, *outputs)
    else:
      output = current_input

    self._last_output_size = _get_shape_without_batch_dimension(output)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: deepmind/sonnet
Commit Name: ce11b92597b32bccf9999e94550855e55e02da9b
Time: 2018-10-16
Author: adriap@google.com
File Name: sonnet/python/modules/basic_rnn.py
Class Name: DeepRNN
Method Name: _build


Project Name: ray-project/ray
Commit Name: 1775e89f262111791fabfd40f80a24f74738fe54
Time: 2020-04-28
Author: sven@anyscale.io
File Name: rllib/models/catalog.py
Class Name: ModelCatalog
Method Name: get_action_dist


Project Name: ray-project/ray
Commit Name: 1775e89f262111791fabfd40f80a24f74738fe54
Time: 2020-04-28
Author: sven@anyscale.io
File Name: rllib/models/tf/tf_action_dist.py
Class Name: MultiActionDistribution
Method Name: logp