parameters: (self, pca_mat_local, n_components, parameter_tuple)
docstring: set pca info.
docstring_summary: set pca info.
docstring_tokens: set pca info .
function: def _set_local_pca_mat(self, pca_mat_local, n_components, parameter_tuple):
          """set pca info."""
          self.n_components = n_components
          local_dim = math.ceil(self.n_components / self.rank_size)
  
          self.start_index = self.rank * local_dim
          self.end_index = (self.rank + 1) * local_dim
  
          start = 0
          self.pca_list_local = ()
          for param in parameter_tuple:
              size = np.shape(param.asnumpy().reshape((-1, 1)))[0]
              self.pca_list_local += (Tensor(pca_mat_local[:, start:start + size], dtype=self.float_type),)
              start += size
  
          self.dk_pad_flag = False
          pad_num = self.rank_size * local_dim - self.n_components
          if pad_num:
              self.dk_pad_flag = True
              self.dk_pad_part = Tensor(np.zeros([pad_num, 1]), dtype=self.float_type)
  
          self.broadcast_list = []
          pca_rank_num = math.ceil(self.n_components / local_dim)
          for i in range(pca_rank_num):
              broadcast = P.Broadcast(i)
              self.broadcast_list.append(broadcast)
function_tokens: def _set_local_pca_mat ( self , pca_mat_local , n_components , parameter_tuple ) : self . n_components = n_components local_dim = math . ceil ( self . n_components / self . rank_size ) self . start_index = self . rank * local_dim self . end_index = ( self . rank + 1 ) * local_dim start = 0 self . pca_list_local = ( ) for param in parameter_tuple : size = np . shape ( param . asnumpy ( ) . reshape ( ( - 1 , 1 ) ) ) [ 0 ] self . pca_list_local += ( Tensor ( pca_mat_local [ : , start : start + size ] , dtype = self . float_type ) , ) start += size self . dk_pad_flag = False pad_num = self . rank_size * local_dim - self . n_components if pad_num : self . dk_pad_flag = True self . dk_pad_part = Tensor ( np . zeros ( [ pad_num , 1 ] ) , dtype = self . float_type ) self . broadcast_list = [ ] pca_rank_num = math . ceil ( self . n_components / local_dim ) for i in range ( pca_rank_num ) : broadcast = P . Broadcast ( i ) self . broadcast_list . append ( broadcast )