5ad7a33a04d8829ad3439b5f9390bd136105f986,allennlp/nn/beam_search.py,BeamSearch,search,#BeamSearch#Any#Any#Any#,48

Before Change


            reconstructed_predictions.append(cur_preds)

            // shape: (batch_size, beam_size)
            cur_backpointers = backpointers[timestep - 1].gather(1, cur_backpointers)

        // shape: (batch_size, beam_size, 1)
        final_preds = predictions[0].gather(1, cur_backpointers).unsqueeze(2)

After Change


        from inspect import signature

        step_signature = signature(step)
        if len(step_signature.parameters) < 3:
            old_step = cast(StepFunctionTypeNoTimestep, step)

            def new_step(
                last_predictions: torch.Tensor, state: Dict[str, torch.Tensor], time_step: int
            ):
                return old_step(last_predictions, state)

            step = new_step

        batch_size = start_predictions.size()[0]

        // List of (batch_size, beam_size) tensors. One for each time step. Does not
        // include the start symbols, which are implicit.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: allenai/allennlp
Commit Name: 5ad7a33a04d8829ad3439b5f9390bd136105f986
Time: 2020-05-28
Author: tobiasr@allenai.org
File Name: allennlp/nn/beam_search.py
Class Name: BeamSearch
Method Name: search


Project Name: keras-team/keras
Commit Name: 6a8815de0cec97480e2f0ce4769ceaf1121274bd
Time: 2016-07-27
Author: pradeep.dasigi@gmail.com
File Name: keras/engine/topology.py
Class Name: Merge
Method Name: compute_mask


Project Name: tryolabs/luminoth
Commit Name: dfe26d7233aaccb1d344ff9ba9995d722503b7e7
Time: 2018-03-20
Author: joaquin.alori@gmail.com
File Name: luminoth/models/ssd/ssd.py
Class Name: SSD
Method Name: _build