39cb01dfe48cf64a02de3cdb41bf0e2d647b20d9,pymc3/variational/flows.py,AbstractFlow,add_param,#AbstractFlow#Any#Any#Any#Any#,145

Before Change


            dtype = theano.config.floatX
        spec = self.__param_spec__[name]
        shape = tuple(eval(s, {"d": self.dim}) for s in spec)
        if self.islocal:
            if user is None:
                raise LocalGroupError("Need parameters for local group flow")
            else:
                shape = (-1,) + shape
                return tt.as_tensor(user).reshape(shape)
        else:
            if user is None:
                return theano.shared(
                    np.asarray(np.random.normal(size=shape) * self.__jitter + ref).astype(dtype),
                    name=name
                )
            else:
                return tt.as_tensor(user).reshape(shape)

    @property
    def params(self):
        return collect_shared_to_list(self.shared_params)

After Change


            if self.islocal:
                raise opvi.LocalGroupError("Need parameters for local group flow")
            if self.batched:
                if self.batch_size is None:
                    raise opvi.BatchedGroupError("Need batch size to infer parameter shape")
                shape = (self.batch_size,) + shape
            return theano.shared(
                np.asarray(np.random.normal(size=shape) * self.__jitter + ref).astype(dtype),
                name=name
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pymc-devs/pymc3
Commit Name: 39cb01dfe48cf64a02de3cdb41bf0e2d647b20d9
Time: 2017-09-02
Author: maxim.v.kochurov@gmail.com
File Name: pymc3/variational/flows.py
Class Name: AbstractFlow
Method Name: add_param


Project Name: rtqichen/torchdiffeq
Commit Name: 18b6c1229b68daeeaaef2266d82ca475f83a7445
Time: 2020-12-18
Author: rtqichen@gmail.com
File Name: torchdiffeq/_impl/rk_common.py
Class Name: RKAdaptiveStepsizeODESolver
Method Name: __init__


Project Name: rtqichen/torchdiffeq
Commit Name: b914816142ae2776f531be1c0b49812a0bfde91f
Time: 2020-08-04
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/adams.py
Class Name: VariableCoefficientAdamsBashforth
Method Name: __init__