6b5813458e9fb1da4a99c2bafc335526955c3dc5,finetune/target_models/multiple_choice.py,MultipleChoicePipeline,_text_to_ids,#MultipleChoicePipeline#Any#Any#Any#,22

Before Change


        kwargs = arrays[0]._asdict()
        kwargs["tokens"] = [arr.tokens for arr in arrays]
        kwargs["token_ids"] = np.stack([arr.token_ids for arr in arrays], 0)
        kwargs["mask"] = np.stack([arr.mask for arr in arrays], 0)
        yield ArrayEncodedOutput(**kwargs)

    def text_to_tokens_mask(self, pair, Y=None, context=None):
        out_gen = self._text_to_ids(pair, pad_token=self.config.pad_token)

After Change


            arrays.append(next(super()._text_to_ids(pair, Y=Y)))

        kwargs = arrays[0]._asdict()
        max_len = max([len(arr.token_ids) for arr in arrays])
        kwargs["tokens"] = [arr.tokens for arr in arrays]
        kwargs["token_ids"] = padded_stack([arr.token_ids for arr in arrays])
        kwargs["mask"] = padded_stack([arr.mask for arr in arrays])
        yield ArrayEncodedOutput(**kwargs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: IndicoDataSolutions/finetune
Commit Name: 6b5813458e9fb1da4a99c2bafc335526955c3dc5
Time: 2020-01-10
Author: benlt@hotmail.co.uk
File Name: finetune/target_models/multiple_choice.py
Class Name: MultipleChoicePipeline
Method Name: _text_to_ids


Project Name: dpressel/mead-baseline
Commit Name: 9d519c382c261166cc26ff66500d2d8eb8fc85fb
Time: 2018-06-29
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/torchy.py
Class Name: CRF
Method Name: decode


Project Name: dmlc/dgl
Commit Name: 5d3f470b721db2a23dcc1a3880c1e31216e06233
Time: 2019-08-05
Author: expye@outlook.com
File Name: python/dgl/batched_graph.py
Class Name:
Method Name: _max_on