8ff49a4b2dbbaf9d76ee5cadd074a955036b3e19,tf_agents/bandits/agents/greedy_reward_prediction_agent_test.py,,_get_initial_and_final_steps_with_action_mask,#Any#Any#,93
Before Change
name="step_type"),
tf.constant(rewards, dtype=tf.float32, name="reward"),
tf.constant(1.0, dtype=tf.float32, shape=[batch_size], name="discount"),
(tf.constant(observations[0] + 100.0), tf.constant(observations[1])))
return initial_step, final_step
After Change
def _get_initial_and_final_steps_with_action_mask(observations, rewards):
batch_size = tf.nest.flatten(observations)[0].shape[0]
initial_step = ts.TimeStep(
tf.constant(
ts.StepType.FIRST,
dtype=tf.int32,
shape=[batch_size],
name="step_type"),
tf.constant(0.0, dtype=tf.float32, shape=[batch_size], name="reward"),
tf.constant(1.0, dtype=tf.float32, shape=[batch_size], name="discount"),
(observations[0], observations[1]))
final_step = ts.TimeStep(
tf.constant(
ts.StepType.LAST,
dtype=tf.int32,
shape=[batch_size],
name="step_type"),
tf.constant(rewards, dtype=tf.float32, name="reward"),
tf.constant(1.0, dtype=tf.float32, shape=[batch_size],
name="discount"), (tf.nest.map_structure(
lambda x: x + 100., observations[0]), observations[1]))
return initial_step, final_step
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: tensorflow/agents
Commit Name: 8ff49a4b2dbbaf9d76ee5cadd074a955036b3e19
Time: 2020-05-12
Author: bartok@google.com
File Name: tf_agents/bandits/agents/greedy_reward_prediction_agent_test.py
Class Name:
Method Name: _get_initial_and_final_steps_with_action_mask
Project Name: tensorflow/agents
Commit Name: 8ff49a4b2dbbaf9d76ee5cadd074a955036b3e19
Time: 2020-05-12
Author: bartok@google.com
File Name: tf_agents/bandits/agents/greedy_reward_prediction_agent_test.py
Class Name:
Method Name: _get_initial_and_final_steps_with_action_mask
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 216553203df0f6ab5c9af2b7b46255dbfb69a04c
Time: 2019-10-10
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/text_test.py
Class Name: TextTest
Method Name: testToWordsWithSpacer
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 216553203df0f6ab5c9af2b7b46255dbfb69a04c
Time: 2019-10-10
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/text_test.py
Class Name: TextTest
Method Name: testToWordsWithJoiner