class_docstr: Record of spaces (i.e., raw action, observation, and associated data) from a single sub-step.
class_docstr_tok: ["Record","of","spaces","(","i.e.",",","raw","action",",","observation",",","and","associated","data",")","from","a","single","sub-step","."]
docstr: Convert the record to numpy.
docstr_tok: ["Convert","the","record","to","numpy","."]
code: def to_numpy(self) -> "SpacesRecord":
      """Convert the record to numpy."""
      self.observation = convert_to_numpy(
          self.observation, cast=None, in_place=True
      )
      self.action = convert_to_numpy(
          self.action, cast=None, in_place=True
      )
      self.reward = self.reward.cpu().numpy()
      self.done = self.done.cpu().numpy()
  
      if self.next_observation is not None:
          self.next_observation = convert_to_numpy(
              self.next_observation, cast=None, in_place=True
          )
  
      if self.logits is not None:
          self.logits = convert_to_numpy(
              self.logits, cast=None, in_place=True
          )
  
      return self
  
file_path: maze/maze/core/trajectory_recording/records/spaces_record.py
imports: from dataclasses import dataclass
  from typing import Dict, Union, Optional, List, Any
  import numpy
  import torch
  from maze.core.env.structured_env import ActorID
  from maze.perception.perception_utils import convert_to_numpy, convert_to_torch
  from maze.train.utils.train_utils import stack_numpy_dict_list, stack_torch_dict_list
label_desc: Use image node_id 4 for calling the SpacesRecord obj's underlying member method code with example usage: obj.to_numpy() and returns: self