Moved weight computation into task_arg_gen