(self, components, return_dtable=True)
return encrypted_tensors
transform numpy array into Paillier tensor and encrypt
transform numpy array into Paillier tensor and encrypt
transform numpy array into Paillier tensor and encrypt
def encrypt_tensor(self, components, return_dtable=True):

        """
        transform numpy array into Paillier tensor and encrypt
        """

        if len(self.encrypt_calculators) == 0:
            self.encrypt_calculators = [self.generated_encrypted_calculator() for i in range(3)]
        encrypted_tensors = []
        for comp, calculator in zip(components, self.encrypt_calculators):
            encrypted_tensor = PaillierTensor(comp, partitions=self.partitions)
            if return_dtable:
                encrypted_tensors.append(encrypted_tensor.encrypt(calculator).get_obj())
            else:
                encrypted_tensors.append(encrypted_tensor.encrypt(calculator))

        return encrypted_tensors
def encrypt_tensor ( self , components , return_dtable = True ) : if len ( self . encrypt_calculators ) == 0 : self . encrypt_calculators = [ self . generated_encrypted_calculator ( ) for i in range ( 3 ) ] encrypted_tensors = [ ] for comp , calculator in zip ( components , self . encrypt_calculators ) : encrypted_tensor = PaillierTensor ( comp , partitions = self . partitions ) if return_dtable : encrypted_tensors . append ( encrypted_tensor . encrypt ( calculator ) . get_obj ( ) ) else : encrypted_tensors . append ( encrypted_tensor . encrypt ( calculator ) ) return encrypted_tensors