code: def run(
      model: BaseModel, dataset: BaseDataset, device, output_path, cfg
  ):
      # Set dataloaders
      num_fragment = dataset.num_fragment
      if cfg.data.is_patch:
          for i in range(num_fragment):
              dataset.set_patches(i)
              dataset.create_dataloaders(
                  model,
                  cfg.training.batch_size,
                  False,
                  cfg.training.num_workers,
                  False,
              )
              loader = dataset.test_dataloaders[0]
              features = []
              scene_name, pc_name = dataset.get_name(i)
  
              with Ctq(loader) as tq_test_loader:
                  for data in tq_test_loader:
                      # pcd = open3d.geometry.PointCloud()
                      # pcd.points = open3d.utility.Vector3dVector(data.pos[0].numpy())
                      # open3d.visualization.draw_geometries([pcd])
                      with torch.no_grad():
                          model.set_input(data, device)
                          model.forward()
                          features.append(model.get_output().cpu())
              features = torch.cat(features, 0).numpy()
              log.info(
                  "save {} from {} in  {}".format(
                      pc_name, scene_name, output_path
                  )
              )
              save(
                  output_path,
                  scene_name,
                  pc_name,
                  dataset.base_dataset[i].to("cpu"),
                  features,
              )
      else:
          dataset.create_dataloaders(
              model,
              1,
              False,
              cfg.training.num_workers,
              False,
          )
          loader = dataset.test_dataloaders[0]
          with Ctq(loader) as tq_test_loader:
              for i, data in enumerate(tq_test_loader):
                  scene_name, pc_name = dataset.get_name(i)
                  # pcd = open3d.geometry.PointCloud()
                  # pcd.points = open3d.utility.Vector3dVector(data.pos.to(torch.float).numpy())
                  # open3d.visualization.draw_geometries([pcd])
                  with torch.no_grad():
                      model.set_input(data, device)
                      model.forward()
                      features = model.get_output()  # batch of 1
                      save(
                          output_path,
                          scene_name,
                          pc_name,
                          data.to("cpu"),
                          features.to("cpu"),
                      )
  
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 2 for calling a global function with example usage: run(model, dataset, device, output_path, cfg) without return types