420747a2f5f6f23b84f62f9a00481ef53a4a4623,train.py,,sample_from_model,#,82

Before Change


    for yi in range(obs_shape[0]):
        for xi in range(obs_shape[1]):
            new_x_gen_np = sess.run(new_x_gen, {x_sample: x_gen})
            x_gen[:,yi,xi,:] = new_x_gen_np[:,yi,xi,:].copy()
    return x_gen

// get loss gradients over multiple GPUs
xs = []

After Change


    x_gen = [np.zeros((args.batch_size,) + obs_shape, dtype=np.float32) for i in range(args.nr_gpu)]
    for yi in range(obs_shape[0]):
        for xi in range(obs_shape[1]):
            new_x_gen_np = sess.run(new_x_gen, {xs[i]: x_gen[i] for i in range(args.nr_gpu)})
            for i in range(args.nr_gpu):
                x_gen[i][:,yi,xi,:] = new_x_gen_np[i][:,yi,xi,:]
    return np.concat(x_gen, axis=0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: openai/pixel-cnn
Commit Name: 420747a2f5f6f23b84f62f9a00481ef53a4a4623
Time: 2016-11-11
Author: tim@Tims-MacBook-Pro.local
File Name: train.py
Class Name:
Method Name: sample_from_model


Project Name: has2k1/plotnine
Commit Name: 6bed5c19be10a34ecc64040f4a00bd336b3e20d0
Time: 2020-03-28
Author: akdor1154@gmail.com
File Name: plotnine/aes.py
Class Name:
Method Name: make_labels


Project Name: rail-berkeley/softlearning
Commit Name: 6d6f8612a0b12636269e3837c6bb27d2ff94e9d3
Time: 2019-01-10
Author: henryee333@gmail.com
File Name: softlearning/samplers/remote_sampler.py
Class Name: RemoteSampler
Method Name: __getstate__