parameters: (self, model)
docstring: The constructor of MVModelParamManager
  
          The constructor will associate the parameter with multiverso array
          table.  The initial value of ArrayTableHandler will be same as the
          parameters of model. If different parameters are used in different
          processes, the average of them will be used as the initial value
docstring_summary: The constructor of MVModelParamManager
docstring_tokens: The constructor of MVModelParamManager
function: def __init__(self, model):
          ''' The constructor of MVModelParamManager
  
          The constructor will associate the parameter with multiverso array
          table.  The initial value of ArrayTableHandler will be same as the
          parameters of model. If different parameters are used in different
          processes, the average of them will be used as the initial value
          '''
          self.shapes = []
          self.dtypes = []
          self.sizes = []
          self.all_param_list = []
          self.model = model
          for arr in self.get_all_param_values():
              self.shapes.append(arr.shape)
              # TODO: Now only float32 is supported in multiverso. So I store all
              # the parameters in a float32 array. This place need modification
              # after other types are supported
              assert(np.dtype("float32") == arr.dtype)
              self.dtypes.append(arr.dtype)
              self.sizes.append(arr.size)
              self.all_param_list.extend([i for i in np.nditer(arr)])
          self.all_param_list = np.array(self.all_param_list)
  
          self.tbh = mv.ArrayTableHandler(len(self.all_param_list), init_value=self.all_param_list)
          mv.barrier()  # add barrier to make sure the initial values have token effect
          self.all_param_list = self.tbh.get()
          self._set_all_param_to_model()
function_tokens: def __init__ ( self , model ) : self . shapes = [ ] self . dtypes = [ ] self . sizes = [ ] self . all_param_list = [ ] self . model = model for arr in self . get_all_param_values ( ) : self . shapes . append ( arr . shape ) # TODO: Now only float32 is supported in multiverso. So I store all # the parameters in a float32 array. This place need modification # after other types are supported assert ( np . dtype ( "float32" ) == arr . dtype ) self . dtypes . append ( arr . dtype ) self . sizes . append ( arr . size ) self . all_param_list . extend ( [ i for i in np . nditer ( arr ) ] ) self . all_param_list = np . array ( self . all_param_list ) self . tbh = mv . ArrayTableHandler ( len ( self . all_param_list ) , init_value = self . all_param_list ) mv . barrier ( ) # add barrier to make sure the initial values have token effect self . all_param_list = self . tbh . get ( ) self . _set_all_param_to_model ( )