0e52a77af80ef1aefb4958564d67ffbcdd24cc84,torchnlp/encoders/encoder.py,Encoder,encode,#Encoder#Any#,40

Before Change


        Returns:
            torch.Tensor: Encoding of the object.
        
        raise NotImplementedError

    def batch_encode(self, batch, *args, **kwargs):
        
        Args:

After Change


        Returns:
            object: Encoding of the object.
        
        if self.enforce_reversible:
            self.enforce_reversible = False
            if self.decode(self.encode(object_)) != object_:
                raise ValueError("Encoding is not reversible for "%s"" % object_)
            self.enforce_reversible = True

        return object_

    def batch_encode(self, iterator, *args, **kwargs):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: PetrochukM/PyTorch-NLP
Commit Name: 0e52a77af80ef1aefb4958564d67ffbcdd24cc84
Time: 2019-04-09
Author: petrochukm@gmail.com
File Name: torchnlp/encoders/encoder.py
Class Name: Encoder
Method Name: encode


Project Name: EducationalTestingService/skll
Commit Name: a20546530c4bafe4a7fd82543110340a781fd906
Time: 2013-07-19
Author: dblanchard@ets.org
File Name: csv_to_megam.py
Class Name:
Method Name:


Project Name: PetrochukM/PyTorch-NLP
Commit Name: 0e52a77af80ef1aefb4958564d67ffbcdd24cc84
Time: 2019-04-09
Author: petrochukm@gmail.com
File Name: torchnlp/encoders/encoder.py
Class Name: Encoder
Method Name: decode