d8f8ac953bc290739aa32a0ad277d53820d4473a,pyprob/comm.py,,get_sample,#Any#,92

Before Change


    sample.address = s.Address().decode("utf-8")
    sample.instance = s.Instance()
    value = s.Value()
    if not value is None:
        sample.value = NDArray_to_Tensor(value)
    distribution_type = s.DistributionType()
    if distribution_type != infcomp.protocol.Distribution.Distribution().NONE:
        if distribution_type == infcomp.protocol.Distribution.Distribution().UniformDiscrete:
            p = infcomp.protocol.UniformDiscrete.UniformDiscrete()

After Change


            p = infcomp.protocol.UniformDiscrete.UniformDiscrete()
            p.Init(s.Distribution().Bytes, s.Distribution().Pos)
            distribution = UniformDiscrete(p.PriorMin(), p.PriorSize())
            if value.dim() > 0:
                value = util.one_hot(distribution.prior_size, int(value[0]) - distribution.prior_min)
        elif distribution_type == infcomp.protocol.Distribution.Distribution().MultivariateNormal:
            p = infcomp.protocol.MultivariateNormal.MultivariateNormal()
            p.Init(s.Distribution().Bytes, s.Distribution().Pos)
            distribution = MultivariateNormal(NDArray_to_Tensor(p.PriorMean()), NDArray_to_Tensor(p.PriorCov()))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: pyprob/pyprob
Commit Name: d8f8ac953bc290739aa32a0ad277d53820d4473a
Time: 2017-08-05
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/comm.py
Class Name:
Method Name: get_sample


Project Name: deepinsight/insightface
Commit Name: 531bcb75ee8295b7229dc4244570bfca40af84ef
Time: 2018-08-17
Author: guojia@gmail.com
File Name: src/train.py
Class Name:
Method Name: get_symbol


Project Name: deepinsight/insightface
Commit Name: ec9aa4d6de1017374665cfc69b35bcda012bc7b7
Time: 2018-08-17
Author: guojia@gmail.com
File Name: src/train.py
Class Name:
Method Name: get_symbol