def calculate_n_inputs(inputs, config_dict):
    """
    Calculate the number of inputs for a particular model.
    """
    input_size = 0
    for input_name in inputs:
        if input_name == 'action':
            input_size += config_dict['prior_args']['n_variables']
        elif input_name == 'state':
            input_size += config_dict['misc_args']['state_size']
        elif input_name == 'reward':
            input_size += 1
        elif input_name in ['params', 'grads']:
            if config_dict['approx_post_args']['constant_scale']:
                input_size += config_dict['prior_args']['n_variables']
            else:
                input_size += 2 * config_dict['prior_args']['n_variables']
    return input_size