8f200a4af5f4708e82dd7d62df8620268a97bebd,pyro/distributions/mixture.py,MaskedMixture,rsample,#MaskedMixture#Any#,109
Before Change
def rsample(self, sample_shape=torch.Size()):
mask = self.mask.expand(sample_shape + self.batch_shape) if sample_shape else self.mask
result = self.component0.rsample(sample_shape)
result[mask] = self.component1.rsample(sample_shape)[mask]
return result
def log_prob(self, value):
After Change
def rsample(self, sample_shape=torch.Size()):
mask = self.mask.reshape(self.mask.shape + (1,) * self.event_dim)
mask = mask.expand(sample_shape + self.shape())
result = torch.where(mask,
self.component1.rsample(sample_shape),
self.component0.rsample(sample_shape))
return result
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: uber/pyro
Commit Name: 8f200a4af5f4708e82dd7d62df8620268a97bebd
Time: 2020-01-22
Author: 50752571+ordabayevy@users.noreply.github.com
File Name: pyro/distributions/mixture.py
Class Name: MaskedMixture
Method Name: rsample
Project Name: uber/pyro
Commit Name: 8f200a4af5f4708e82dd7d62df8620268a97bebd
Time: 2020-01-22
Author: 50752571+ordabayevy@users.noreply.github.com
File Name: pyro/distributions/mixture.py
Class Name: MaskedMixture
Method Name: sample
Project Name: cornellius-gp/gpytorch
Commit Name: cea478600970228f6b8dd12b067facde3d5d261f
Time: 2019-05-08
Author: balandat@fb.com
File Name: gpytorch/models/exact_gp.py
Class Name: ExactGP
Method Name: get_fantasy_model
Project Name: ixaxaar/pytorch-dnc
Commit Name: 2026a8939d9ccc3e26ac776db5b4788846fd166c
Time: 2017-12-03
Author: root@ixaxaar.in
File Name: dnc/sparse_memory.py
Class Name: SparseMemory
Method Name: read_from_sparse_memory