code: def assert_cfg(cfg):
      r"""Checks config values, do necessary post processing to the configs."""
      if cfg.dataset.task not in ["node", "edge", "graph", "link_pred"]:
          raise ValueError(
              f"Task '{cfg.dataset.task}' not supported. Must be "
              f"one of node, edge, graph, link_pred"
          )
      if (
          "classification" in cfg.dataset.task_type
          and cfg.model.loss_fun == "mse"
      ):
          cfg.model.loss_fun = "cross_entropy"
          logging.warning(
              "model.loss_fun changed to cross_entropy for classification."
          )
      if (
          cfg.dataset.task_type == "regression"
          and cfg.model.loss_fun == "cross_entropy"
      ):
          cfg.model.loss_fun = "mse"
          logging.warning(
              "model.loss_fun changed to mse for regression."
          )
      if cfg.dataset.task == "graph" and cfg.dataset.transductive:
          cfg.dataset.transductive = False
          logging.warning(
              "dataset.transductive changed " "to False for graph task."
          )
      if cfg.gnn.layers_post_mp < 1:
          cfg.gnn.layers_post_mp = 1
          logging.warning("Layers after message passing should be >=1")
      if cfg.gnn.head == "default":
          cfg.gnn.head = cfg.dataset.task
      cfg.run_dir = cfg.out_dir
  
file_path: pytorch_geometric/torch_geometric/graphgym/config.py
imports: import functools
  import inspect
  import logging
  import os
  import os.path
  import warnings
  from collections.abc import Iterable
  from dataclasses import asdict
  from typing import Any
  import torch_geometric.graphgym.register
  from torch_geometric.io import fs
label_desc: Use image node_id 2 for calling a global function with example usage: assert_cfg(cfg) without return types