3297b14525656040f3a456b2c23c7ffb7e6b7cfc,src/spn/algorithms/layerwise/distributions.py,,dist_sample,#Any#Any#,40

Before Change


    // If parent idx into multiplicity are given
    if parent_idxs is not None:
        // Choose only specific samples for each feature/scope
        samples = samples[:, range(samples.shape[1]), parent_idxs]

    // Squeeze first dimension which should be of size 1
    samples.squeeze_(0)

After Change


    // If parent index into multiplicity are given
    if parent_indices is not None:
        // Choose only specific samples for each feature/scope
        samples = torch.gather(samples, dim=2, index=parent_indices.unsqueeze(-1)).squeeze(-1)

    return samples

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: SPFlow/SPFlow
Commit Name: 3297b14525656040f3a456b2c23c7ffb7e6b7cfc
Time: 2020-03-22
Author: steven.lang.mz@gmail.com
File Name: src/spn/algorithms/layerwise/distributions.py
Class Name:
Method Name: dist_sample


Project Name: pytorch/fairseq
Commit Name: 831b6b6e7f16a14ca8cd5a4d998a05a974a1d2b2
Time: 2019-11-19
Author: namangoyal@devfair0110.h2.fair
File Name: fairseq/models/bart/hub_interface.py
Class Name: BARTHubInterface
Method Name: extract_features