09e72f2042e26725632082d93df70cbc86071d38,reagent/gym/tests/preprocessors/test_replay_buffer_inserters.py,TestBasicReplayBufferInserter,test_cartpole,#TestBasicReplayBufferInserter#,12
Before Change
obs = env.reset()
terminal = False
i = 0
while not terminal and i < 5:
action = env.action_space.sample()
next_obs, reward, terminal, _ = env.step(action)
replay_buffer_inserter(
replay_buffer, obs, action, reward, terminal, log_prob=0.0
)
obs = next_obs
After Change
def test_cartpole(self):
env = gym.make("CartPole-v0")
replay_buffer, inserted = _create_replay_buffer_and_insert(env)
batch = replay_buffer.sample_transition_batch_tensor(indices=np.array([0]))
npt.assert_array_almost_equal(
inserted[0]["observation"], batch.state.squeeze(0)
)
npt.assert_array_almost_equal(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: facebookresearch/Horizon
Commit Name: 09e72f2042e26725632082d93df70cbc86071d38
Time: 2020-05-13
Author: kittipat@fb.com
File Name: reagent/gym/tests/preprocessors/test_replay_buffer_inserters.py
Class Name: TestBasicReplayBufferInserter
Method Name: test_cartpole
Project Name: pantsbuild/pants
Commit Name: 14759e1065e307c7760299670da30f64ffdbf783
Time: 2016-08-27
Author: stuhood@gmail.com
File Name: src/python/pants/engine/engine.py
Class Name: LocalMultiprocessEngine
Method Name: _submit_until
Project Name: pantsbuild/pants
Commit Name: 14759e1065e307c7760299670da30f64ffdbf783
Time: 2016-08-27
Author: stuhood@gmail.com
File Name: src/python/pants/engine/engine.py
Class Name: ThreadHybridEngine
Method Name: _submit_until