(self, comp_to_send, epoch_idx)
send guest components and get host components
send guest components and get host components
send guest components and get host components
def exchange_components(self, comp_to_send, epoch_idx):

        """
        send guest components and get host components
        """

        if self.mode == 'encrypted':
            comp_to_send = self.encrypt_tensor(comp_to_send)

        # sending [y_overlap_2_phi_2, y_overlap_phi, mapping_comp_a]
        self.transfer_variable.y_overlap_2_phi_2.remote(comp_to_send[0], suffix=(epoch_idx, ))
        self.transfer_variable.y_overlap_phi.remote(comp_to_send[1], suffix=(epoch_idx, ))
        self.transfer_variable.mapping_comp_a.remote(comp_to_send[2], suffix=(epoch_idx, ))

        # receiving [overlap_ub, overlap_ub_2, mapping_comp_b]
        overlap_ub = self.transfer_variable.overlap_ub.get(idx=0, suffix=(epoch_idx, ))
        overlap_ub_2 = self.transfer_variable.overlap_ub_2.get(idx=0, suffix=(epoch_idx, ))
        mapping_comp_b = self.transfer_variable.mapping_comp_b.get(idx=0, suffix=(epoch_idx, ))
        host_components = [overlap_ub, overlap_ub_2, mapping_comp_b]

        if self.mode == 'encrypted':
            host_paillier_tensors = [PaillierTensor(tb, partitions=self.partitions) for tb in host_components]
            return host_paillier_tensors
        else:
            return host_components
def exchange_components ( self , comp_to_send , epoch_idx ) : if self . mode == 'encrypted' : comp_to_send = self . encrypt_tensor ( comp_to_send ) # sending [y_overlap_2_phi_2, y_overlap_phi, mapping_comp_a] self . transfer_variable . y_overlap_2_phi_2 . remote ( comp_to_send [ 0 ] , suffix = ( epoch_idx , ) ) self . transfer_variable . y_overlap_phi . remote ( comp_to_send [ 1 ] , suffix = ( epoch_idx , ) ) self . transfer_variable . mapping_comp_a . remote ( comp_to_send [ 2 ] , suffix = ( epoch_idx , ) ) # receiving [overlap_ub, overlap_ub_2, mapping_comp_b] overlap_ub = self . transfer_variable . overlap_ub . get ( idx = 0 , suffix = ( epoch_idx , ) ) overlap_ub_2 = self . transfer_variable . overlap_ub_2 . get ( idx = 0 , suffix = ( epoch_idx , ) ) mapping_comp_b = self . transfer_variable . mapping_comp_b . get ( idx = 0 , suffix = ( epoch_idx , ) ) host_components = [ overlap_ub , overlap_ub_2 , mapping_comp_b ] if self . mode == 'encrypted' : host_paillier_tensors = [ PaillierTensor ( tb , partitions = self . partitions ) for tb in host_components ] return host_paillier_tensors else : return host_components