code: def test_model(model, data=None, check_children=False):
      """
      Test model interface.
  
      Interface
      ---------
      - model.from_hyper_parameter()
      - model.model.forward()
      - model.to()
      - model.initialize()
      """
      assert isinstance(model, BaseAutoModel)
      assert hasattr(model, "to")
      assert hasattr(model, "initialize")
      model.initialize()
      model.to("cuda")
      if data is not None:
          data = data.to("cuda")
  
      assert hasattr(model, "model")
      __model = model.model
      assert isinstance(__model, torch.nn.Module)
  
      if data is not None:
          __model.forward(data)
  
      # FIXME: we can only perform tests when hyper_parameter_space is []
      if len(model.hyper_parameter_space) == 0:
          model_2 = model.from_hyper_parameter({})
          if check_children:
              test_model(model_2, data)
  
file_path: AutoGL/test/nas/node_classification.py
imports: import os
  import logging
  from autogl.backend import DependentBackend
  from autogl.datasets import build_dataset_from_name
  import torch
  import torch.nn.functional
  from autogl.module.nas.space.single_path import SinglePathNodeClassificationSpace
  from autogl.module.nas.space.graph_nas import GraphNasNodeClassificationSpace
  from autogl.module.nas.space.graph_nas_macro import GraphNasMacroNodeClassificationSpace
  from autogl.module.nas.estimator.one_shot import OneShotEstimator
  from autogl.module.nas.space.autoattend import AutoAttendNodeClassificationSpace
  from autogl.module.nas.backend import bk_feat, bk_label
  from autogl.module.nas.algorithm import Darts, RL, GraphNasRL, Enas, RandomSearch, Spos
  import numpy
  from autogl.solver.utils import set_seed
label_desc: Use image node_id 1 for calling a global function with example usage: test_model(model, data, check_children) without return types