(self, comp_to_send, epoch_idx)
compute host components and sent to guest
compute host components and sent to guest
compute host components and sent to guest
def exchange_components(self, comp_to_send, epoch_idx):

        """
        compute host components and sent to guest
        """

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

        # receiving guest components
        y_overlap_2_phi_2 = self.transfer_variable.y_overlap_2_phi_2.get(idx=0, suffix=(epoch_idx, ))
        y_overlap_phi = self.transfer_variable.y_overlap_phi.get(idx=0, suffix=(epoch_idx, ))
        mapping_comp_a = self.transfer_variable.mapping_comp_a.get(idx=0, suffix=(epoch_idx, ))
        guest_components = [y_overlap_2_phi_2, y_overlap_phi, mapping_comp_a]

        # sending host components
        self.transfer_variable.overlap_ub.remote(comp_to_send[0], suffix=(epoch_idx, ))
        self.transfer_variable.overlap_ub_2.remote(comp_to_send[1], suffix=(epoch_idx, ))
        self.transfer_variable.mapping_comp_b.remote(comp_to_send[2], suffix=(epoch_idx, ))

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