5b81086d43f760dc2a4924d81f7c39b9e9c37d50,tf_encrypted/tensor/int100.py,Int100Factory,tensor,#Int100Factory#Any#,97

Before Change


        if isinstance(value, (tf.Tensor, np.ndarray)):
            return Int100Tensor(_crt_decompose(value))

        if isinstance(value, Int100Tensor):
            // TODO[Morten] should we just be the identity here to not bypass cached nodes?
            return Int100Tensor(value.backing)

        raise TypeError("Don"t know how to handle {}", type(value))

    def seeded_tensor(self, shape, seed):

After Change


    def tensor(self, value) -> "Int100Tensor":

        if isinstance(value, tf.Tensor):
            if value.dtype is not self.native_type:
                value = tf.cast(value, dtype=self.native_type)
            return Int100Tensor(_crt_decompose(value))

        if isinstance(value, np.ndarray):
            return Int100Tensor(_crt_decompose(value))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: mortendahl/tf-encrypted
Commit Name: 5b81086d43f760dc2a4924d81f7c39b9e9c37d50
Time: 2019-01-10
Author: mortendahlcs@gmail.com
File Name: tf_encrypted/tensor/int100.py
Class Name: Int100Factory
Method Name: tensor


Project Name: mortendahl/tf-encrypted
Commit Name: 5b81086d43f760dc2a4924d81f7c39b9e9c37d50
Time: 2019-01-10
Author: mortendahlcs@gmail.com
File Name: tf_encrypted/tensor/prime.py
Class Name: PrimeFactory
Method Name: tensor


Project Name: mortendahl/tf-encrypted
Commit Name: 5b81086d43f760dc2a4924d81f7c39b9e9c37d50
Time: 2019-01-10
Author: mortendahlcs@gmail.com
File Name: tf_encrypted/tensor/int32.py
Class Name: Int32Factory
Method Name: tensor