1bb8f15b13d1fb3713366228d431da29b2e5c43e,pyro/distributions/torch_distribution.py,MaskedDistribution,__init__,#MaskedDistribution#Any#Any#,254

Before Change


        if isinstance(mask, bool):
            self._mask = mask
        else:
            if broadcast_shape(mask.shape, base_dist.batch_shape) != base_dist.batch_shape:
                raise ValueError("Expected mask.shape to be broadcastable to base_dist.batch_shape, "
                                 "actual {} vs {}".format(mask.shape, base_dist.batch_shape))
            self._mask = mask.bool()
        super(MaskedDistribution, self).__init__(base_dist.batch_shape, base_dist.event_shape)

    def expand(self, batch_shape, _instance=None):

After Change


            self._mask = mask
        else:
            batch_shape = broadcast_shape(mask.shape, base_dist.batch_shape)
            if mask.shape != batch_shape:
                mask = mask.expand(batch_shape)
            if base_dist.batch_shape != batch_shape:
                base_dist = base_dist.expand(batch_shape)
            self._mask = mask.bool()
        self.base_dist = base_dist
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: uber/pyro
Commit Name: 1bb8f15b13d1fb3713366228d431da29b2e5c43e
Time: 2020-01-25
Author: 50752571+ordabayevy@users.noreply.github.com
File Name: pyro/distributions/torch_distribution.py
Class Name: MaskedDistribution
Method Name: __init__


Project Name: cornellius-gp/gpytorch
Commit Name: b0eecef1c8acdfe6e65f1e96ff6e26d2bc43e7db
Time: 2018-11-09
Author: balandat@fb.com
File Name: gpytorch/lazy/diag_lazy_tensor.py
Class Name: DiagLazyTensor
Method Name: _quad_form_derivative


Project Name: cornellius-gp/gpytorch
Commit Name: a7a12d157766b69cf4b1ddbb5fcdacfe485dc6fa
Time: 2019-04-03
Author: gpleiss@gmail.com
File Name: gpytorch/kernels/grid_kernel.py
Class Name: GridKernel
Method Name: forward