2eb4c5f77bd8da9b1e23851b0acb84543e442953,python/baseline/pytorch/classify/model.py,WordClassifierModelBase,make_input,#WordClassifierModelBase#Any#,61

Before Change



    def make_input(self, batch_dict):
        x = batch_dict["x"]
        xch = batch_dict.get("xch")
        y = batch_dict.get("y")
        lengths = batch_dict.get("lengths")
        if self.gpu:
            x = x.cuda()

After Change



        y = batch_dict.get("y")
        if y is not None:
            y = torch.from_numpy(y)
            if self.gpu is not None:
                y = y.cuda()
            example_dict["y"] = y

        return example_dict

    def forward(self, input):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: dpressel/mead-baseline
Commit Name: 2eb4c5f77bd8da9b1e23851b0acb84543e442953
Time: 2018-09-24
Author: dpressel@gmail.com
File Name: python/baseline/pytorch/classify/model.py
Class Name: WordClassifierModelBase
Method Name: make_input


Project Name: kengz/SLM-Lab
Commit Name: aa4ae658489c919dbca4141c7498b05ac0cac6d8
Time: 2019-05-25
Author: kengzwl@gmail.com
File Name: slm_lab/agent/__init__.py
Class Name: AgentSpace
Method Name: act


Project Name: facebookresearch/Horizon
Commit Name: 9cf8f6cdf6a2008843cb37da6e34b8d10353b0bf
Time: 2019-12-12
Author: kittipat@fb.com
File Name: ml/rl/preprocessing/sparse_to_dense.py
Class Name: PythonSparseToDenseProcessor
Method Name: process