272123ed029d2e8f73e83d1d9ab1a96c56cead15,tensorflow_encrypted/tensor/prime.py,PrimeTensor,add,#PrimeTensor#Any#,69

Before Change


        return self.mod(k)

    def add(self, other: Union["PrimeTensor", int]) -> "PrimeTensor":
        x, y = _lift(self, self.modulus), _lift(other, self.modulus)
        return PrimeTensor((x.value + y.value) % self.modulus, self.modulus)

    def sub(self, other: Union["PrimeTensor", int]) -> "PrimeTensor":
        x, y = _lift(self, self.modulus), _lift(other, self.modulus)

After Change


        return self.mod(k)

    def add(self, other) -> "PrimeTensor":
        x, y = _lift(self, other)
        return self.factory.tensor((x.value + y.value) % self.modulus)

    def sub(self, other) -> "PrimeTensor":
        x, y = _lift(self, other)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: mortendahl/tf-encrypted
Commit Name: 272123ed029d2e8f73e83d1d9ab1a96c56cead15
Time: 2018-10-10
Author: bendecoste@gmail.com
File Name: tensorflow_encrypted/tensor/prime.py
Class Name: PrimeTensor
Method Name: add


Project Name: mortendahl/tf-encrypted
Commit Name: 272123ed029d2e8f73e83d1d9ab1a96c56cead15
Time: 2018-10-10
Author: bendecoste@gmail.com
File Name: tensorflow_encrypted/tensor/prime.py
Class Name: PrimeTensor
Method Name: mul


Project Name: mortendahl/tf-encrypted
Commit Name: 272123ed029d2e8f73e83d1d9ab1a96c56cead15
Time: 2018-10-10
Author: bendecoste@gmail.com
File Name: tensorflow_encrypted/tensor/prime.py
Class Name: PrimeTensor
Method Name: sub


Project Name: mortendahl/tf-encrypted
Commit Name: 272123ed029d2e8f73e83d1d9ab1a96c56cead15
Time: 2018-10-10
Author: bendecoste@gmail.com
File Name: tensorflow_encrypted/tensor/prime.py
Class Name: PrimeTensor
Method Name: matmul