ae003338600bb9188fa5a1901a3a3ecc8fda351c,ptan/agent.py,,default_states_preprocessor,#,38

Before Change


        np_states = np.expand_dims(states[0], 0)
    else:
        np_states = np.array([np.array(s, copy=False) for s in states], copy=False)
    v = Variable(torch.from_numpy(np_states), volatile=volatile)
    if cuda:
        v = v.cuda(device=device_id)
    return v


def float32_preprocessor(states, cuda=False, device_id=None, volatile=False):
    np_states = np.array(states, dtype=np.float32)

After Change


        np_states = np.expand_dims(states[0], 0)
    else:
        np_states = np.array([np.array(s, copy=False) for s in states], copy=False)
    return torch.tensor(np_states)


def float32_preprocessor(states):
    np_states = np.array(states, dtype=np.float32)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: Shmuma/ptan
Commit Name: ae003338600bb9188fa5a1901a3a3ecc8fda351c
Time: 2018-04-27
Author: max.lapan@gmail.com
File Name: ptan/agent.py
Class Name:
Method Name: default_states_preprocessor


Project Name: Shmuma/ptan
Commit Name: ae003338600bb9188fa5a1901a3a3ecc8fda351c
Time: 2018-04-27
Author: max.lapan@gmail.com
File Name: ptan/agent.py
Class Name:
Method Name: float32_preprocessor


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 84e2cf87e0fe23fe3432b74ab484b1b71cd729b3
Time: 2018-04-29
Author: max.lapan@gmail.com
File Name: ch18/lib/model.py
Class Name:
Method Name: state_lists_to_batch