code: def main(cfg):
      OmegaConf.set_struct(cfg, False)
  
      # Get device
      device = torch.device(
          "cuda"
          if (torch.cuda.is_available() and cfg.training.cuda)
          else "cpu"
      )
      log.info("DEVICE : {}".format(device))
  
      # Enable CUDNN BACKEND
      torch.backends.cudnn.enabled = cfg.training.enable_cudnn
  
      # Checkpoint
      checkpoint = ModelCheckpoint(
          cfg.training.checkpoint_dir,
          cfg.model_name,
          cfg.training.weight_name,
          strict=True,
      )
  
      # Setup the dataset config
      # Generic config
  
      dataset = instantiate_dataset(cfg.data)
      model = checkpoint.create_model(
          dataset, weight_name=cfg.training.weight_name
      )
      log.info(model)
      log.info(
          "Model size = %i",
          sum(
              param.numel()
              for param in model.parameters()
              if param.requires_grad
          ),
      )
  
      log.info(dataset)
  
      model.eval()
      if cfg.enable_dropout:
          model.enable_dropout_in_eval()
      model = model.to(device)
  
      # Run training / evaluation
      output_path = os.path.join(
          cfg.training.checkpoint_dir, cfg.data.name, "features"
      )
      if not os.path.exists(output_path):
          os.makedirs(output_path, exist_ok=True)
  
      run(model, dataset, device, output_path, cfg)
  
file_path: torch-points3d/scripts/test_registration_scripts/save_feature.py
imports: import open3d
  import torch
  import hydra
  import logging
  from omegaconf import OmegaConf
  import os
  import os.path
  import sys
  import numpy
  from torch_points3d.datasets.dataset_factory import instantiate_dataset, get_dataset_class
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.metrics.colored_tqdm import Coloredtqdm
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
  from torch_points3d.utils.colors import COLORS
label_desc: Use image node_id 3 for calling a global function with example usage: main(cfg) without return types