22cb76a3479ceba89addb1f467c2dd573cb29026,pytext/torchscript/module.py,ScriptPyTextEmbeddingModule,make_prediction,#ScriptPyTextEmbeddingModule#,283

Before Change


        //   cross-request batches and client side
        //   batches into a cross-request list of
        //   client-side batch tensors
        start = 0
        for elems in client_batch:
            end = start + elems
            res_list.append(flat_result.narrow(0, start, elems))
            start = end

        return res_list

After Change


            raise RuntimeError("Parameter type unsupported")

        // if torch.jit.isinstance(flat_result, torch.Tensor):
        if isinstance(flat_result, torch.Tensor):
            // destructure flat result tensor combining
            //   cross-request batches and client side
            //   batches into a cross-request list of
            //   client-side batch tensors
            return destructure_tensor(client_batch, flat_result)
        else:
            // destructure result list of any result type combining
            //   cross-request batches and client side
            //   batches into a cross-request list of
            //   client-side result lists
            result_texts_any_list: List[Any] = torch.jit.annotate(List[Any], [])
            for v in flat_result:
                result_texts_any_list.append(v)

            return destructure_any_list(client_batch, result_texts_any_list)

    @torch.jit.script_method
    def make_batch(
        self,
        mega_batch: List[
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebookresearch/pytext
Commit Name: 22cb76a3479ceba89addb1f467c2dd573cb29026
Time: 2021-02-16
Author: mikekg@fb.com
File Name: pytext/torchscript/module.py
Class Name: ScriptPyTextEmbeddingModule
Method Name: make_prediction


Project Name: ncullen93/torchsample
Commit Name: 2079a72d90e527149e527b5cb376b37ddc9e25bd
Time: 2017-05-09
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Affine
Method Name: __init__


Project Name: scikit-learn-contrib/sklearn-pandas
Commit Name: 1c7a87e96c4b6180e423586193c26e5ccd2f6bfd
Time: 2015-08-02
Author: mahmoud@thehumangeo.com
File Name: sklearn_pandas/__init__.py
Class Name: DataFrameMapper
Method Name: transform