230503ac56636d91d53d728c247c6ea3d096eeb9,tf_agents/environments/tf_py_environment_test.py,TFPYEnvironmentTest,testOneStep,#TFPYEnvironmentTest#Any#,194

Before Change


    else:
      tf_env = tf_py_environment.TFPyEnvironment(py_env)
    _, step_data = tf_env.current_time_step()
    time_step, step_data = self.evaluate(
        tf_env.step([np.array([1])], step_data))

    self.assertAllEqual([ts.StepType.MID], time_step.step_type)
    self.assertAllEqual([0.], time_step.reward)
    self.assertAllEqual([1.0], time_step.discount)

After Change


    else:
      tf_env = tf_py_environment.TFPyEnvironment(py_env)
    time_step = tf_env.current_time_step()
    with tf.control_dependencies([time_step.step_type]):
      action = tf.constant([1])
    time_step = self.evaluate(tf_env.step(action))

    self.assertAllEqual([ts.StepType.MID], time_step.step_type)
    self.assertAllEqual([0.], time_step.reward)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: tensorflow/agents
Commit Name: 230503ac56636d91d53d728c247c6ea3d096eeb9
Time: 2018-11-30
Author: sguada@google.com
File Name: tf_agents/environments/tf_py_environment_test.py
Class Name: TFPYEnvironmentTest
Method Name: testOneStep


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: f8a5a458ff6a35e91ae9d705160d73cdcc8adf97
Time: 2017-05-31
Author: valentina.zantedeschi@ibm.com
File Name: test.py
Class Name:
Method Name:


Project Name: explosion/thinc
Commit Name: 6ac9487579408b1ee452fbb27ef4c781882d085c
Time: 2017-01-13
Author: honnibal+gh@gmail.com
File Name: examples/mnist_mlp.py
Class Name:
Method Name: main


Project Name: comic/grand-challenge.org
Commit Name: f84523e048a7592cb3f09f25d3968128575ba064
Time: 2017-11-06
Author: jamesmeakin@gmail.com
File Name: app/evaluation/tasks.py
Class Name:
Method Name: evaluate_submission