code: def test_record_conversion():
      r = _mock_structured_spaces_record(1)
  
      r.to_torch("cpu")
      for step_key in [0, 1]:
          for value in r.observations_dict[step_key].values():
              assert isinstance(value, torch.Tensor)
          for value in r.actions_dict[step_key].values():
              assert isinstance(value, torch.Tensor)
  
      r.to_numpy()
      for step_key in [0, 1]:
          for value in r.observations_dict[step_key].values():
              assert isinstance(value, np.ndarray)
          for value in r.actions_dict[step_key].values():
              assert isinstance(value, np.ndarray)
  
file_path: maze/maze/test/core/trajectory_recording/test_spaces_step_record.py
imports: from typing import List, Union
  import numpy
  import torch
  from maze.core.env.structured_env import ActorID
  from maze.core.trajectory_recording.records.spaces_record import SpacesRecord
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
label_desc: Use image node_id 4 for calling a global function with example usage: test_record_conversion() without return types