def METHOD_NAME(model_dict, sample_num_dict, worker_num):
    start_time = time.time()
    model_list = []
    training_num = 0
    for idx in range(worker_num):
        fedml.logger.info("self.model_dict[idx] = {}".format(model_dict[idx]))
        mnn_file_path = model_dict[idx]
        tensor_params_dict = read_mnn_as_tensor_dict(mnn_file_path)
        model_list.append((sample_num_dict[idx], tensor_params_dict))
        training_num += sample_num_dict[idx]
    fedml.logger.info("training_num = {}".format(training_num))
    fedml.logger.info("len of self.model_dict[idx] = " + str(len(model_dict)))
    # logger.info("################aggregate: %d" % len(model_list))
    (num0, averaged_params) = model_list[0]
    for k in averaged_params.keys():
        for i in range(0, len(model_list)):
            local_sample_number, local_model_params = model_list[i]
            w = local_sample_number / training_num
            fedml.logger.info("w = {}".format(w))
            if i == 0:
                averaged_params[k] = local_model_params[k] * w
            else:
                averaged_params[k] += local_model_params[k] * w
    end_time = time.time()
    fedml.logger.info("aggregate time cost: %d" % (end_time - start_time))
    print(len(averaged_params.keys()))
    return averaged_params