9b7f4d373f553711babfd13f6c67b3ddfe546a97,python/magent/model.py,NDArrayPackage,recv_from,#NDArrayPackage#Any#,79

Before Change


            conn.send_bytes(x)

    def recv_from(self, conn):
        bufs = [np.empty(shape=x[0], dtype=x[1]) for x in self.info]
        for buf in bufs:
            conn.recv_bytes_into(buf)
        return bufs

After Change


        for info in self.info:
            buf = np.empty(shape=(int(np.prod(info[0])),), dtype=info[1])

            item_size = int(np.prod(info[0][1:]))
            if np.prod(info[0]) > self.max_len:
                seg = int(self.max_len // item_size)
                for pt in range(0, int(np.prod(info[0])), seg * item_size):
                    conn.recv_bytes_into(buf[pt:pt+seg * item_size])
            else:
               conn.recv_bytes_into(buf)
            bufs.append(buf.reshape(info[0]))
        return bufs
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: geek-ai/MAgent
Commit Name: 9b7f4d373f553711babfd13f6c67b3ddfe546a97
Time: 2017-12-03
Author: zhenglianmin96@163.com
File Name: python/magent/model.py
Class Name: NDArrayPackage
Method Name: recv_from


Project Name: pymc-devs/pymc3
Commit Name: 52d2340cb3074d848125722e411c1ba69fd08174
Time: 2017-07-16
Author: adrian.seyboldt@gmail.com
File Name: pymc3/step_methods/hmc/base_hmc.py
Class Name: BaseHMC
Method Name: __init__


Project Name: NifTK/NiftyNet
Commit Name: 135a56e0935fbb04811f8ce7b9f514f498212f71
Time: 2018-07-25
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/crf.py
Class Name:
Method Name: ftheta