(model_params, master_params,
                 flat_master: bool = False)
Copy `master_params` to `model_params`.
Copy `master_params` to `model_params`.
Copy master_params to model_params .
def master2model(model_params, master_params,
                 flat_master: bool = False) -> None:
    "Copy `master_params` to `model_params`."
    if flat_master:
        for model_group, master_group in zip(model_params, master_params):
            if len(model_group) != 0:
                for model, master in zip(
                        model_group,
                        _unflatten_dense_tensors(master_group[0].data,
                                                 model_group)):
                    model.data.copy_(master)
    else:
        for model_group, master_group in zip(model_params, master_params):
            for model, master in zip(model_group, master_group):
                model.data.copy_(master.data)
def master2model ( model_params , master_params , flat_master : bool = False ) -> None : if flat_master : for model_group , master_group in zip ( model_params , master_params ) : if len ( model_group ) != 0 : for model , master in zip ( model_group , _unflatten_dense_tensors ( master_group [ 0 ] . data , model_group ) ) : model . data . copy_ ( master ) else : for model_group , master_group in zip ( model_params , master_params ) : for model , master in zip ( model_group , master_group ) : model . data . copy_ ( master . data )