9a06cce3a455541e3f606552560c9efa4830c9b8,Tars/distributions/distribution_models.py,DistributionModel,sample,#DistributionModel#Any#Any#Any#Any#Any#,55

Before Change


                {self.var[0]: self._get_sample(reparam=reparam,
                                               sample_shape=sample_shape)}

        elif x is not None:  // conditional
            if type(x) is torch.Tensor:
                x = {self.cond_var[0]: x}

            elif type(x) is list:
                x = dict(zip(self.cond_var, x))

            elif type(x) is dict:
                if not set(list(x.keys())) == set(self.cond_var):
                    raise ValueError("Input"s keys are not valid.")

            else:
                raise ValueError("Invalid input")

            params = self._get_forward(x)
            self._set_dist(params)

After Change


        else:  // conditional
            x = self._verify_input(x)
            params = self.forward(**x)
            print(params)
            self._set_dist(**params)

            output = {self.var[0]: self._get_sample(reparam=reparam)}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: masa-su/pixyz
Commit Name: 9a06cce3a455541e3f606552560c9efa4830c9b8
Time: 2018-07-09
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/distributions/distribution_models.py
Class Name: DistributionModel
Method Name: sample


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 7fd01ef15a6c449b3cae769a4927d3561de82f45
Time: 2018-08-29
Author: Maria-Irina.Nicolae@ibm.com
File Name: art/classifiers/classifier.py
Class Name: Classifier
Method Name: __init__


Project Name: vatlab/SoS
Commit Name: b3192bf244120efa901cc9c46fe36fb6fb501803
Time: 2016-11-19
Author: ben.bog@gmail.com
File Name: sos/__main__.py
Class Name:
Method Name: cmd_run