033f2625feff5428a243df1c1220830739dc7d3c,pytext/torchscript/module.py,ScriptPyTextVariableSizeEmbeddingModule,make_prediction,#ScriptPyTextVariableSizeEmbeddingModule#Any#,521

Before Change


        if argno == TEXTS:
            flat_texts: List[str] = []

            for i in range(batchsize):
                batch_element = batch[i][0]
                if batch_element is not None:
                    flat_texts.extend(batch_element)
                    client_batch.append(len(batch_element))
                else:
                    // At present, we abort the entire batch if
                    // any batch element is malformed.
                    //
                    // Possible refinement:
                    // we can skip malformed requests,
                    // and return a list plus an indiction that one or more
                    // batch elements (and which ones) were malformed
                    raise RuntimeError("Malformed request.")

            flat_result: List[torch.Tensor] = self.forward(
                texts=flat_texts,
                multi_texts=None,
                tokens=None,

After Change


                    // batch elements (and which ones) were malformed
                    raise RuntimeError("(VE) Malformed request.")

            if len(flat_texts) == 0:
                raise RuntimeError("This is not good. Empty request batch.")

            flat_result: List[torch.Tensor] = self.forward(
                texts=flat_texts,
                multi_texts=None,
                tokens=None,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: facebookresearch/pytext
Commit Name: 033f2625feff5428a243df1c1220830739dc7d3c
Time: 2020-10-02
Author: mikekg@fb.com
File Name: pytext/torchscript/module.py
Class Name: ScriptPyTextVariableSizeEmbeddingModule
Method Name: make_prediction


Project Name: grrrr/nsgt
Commit Name: 523a62159f0324438901e9716b593775ec4c5c10
Time: 2012-08-31
Author: gr@grrrr.org
File Name: nsgt/nsigtf.py
Class Name:
Method Name: nsigtf_sl


Project Name: grrrr/nsgt
Commit Name: 523a62159f0324438901e9716b593775ec4c5c10
Time: 2012-08-31
Author: gr@grrrr.org
File Name: nsgt/nsgtf.py
Class Name:
Method Name: nsgtf_sl


Project Name: deepmipt/DeepPavlov
Commit Name: 3b3f8bd00c463e441600673141ff2de608880c9a
Time: 2018-02-05
Author: yoptar@gmail.com
File Name: deeppavlov/datasets/dialog_dataset.py
Class Name: DialogDataset
Method Name: batch_generator