class_docstr: A Structure stores a Torch Tensor and labeled states.
  Inspired from the paper:
  PatrickStar: Parallel Training of Pre-trained Models via Chunk-based Memory Management
  
  https://arxiv.org/abs/2108.05818
class_docstr_tok: ["A","Structure","stores","a","Torch","Tensor","and","labeled","states",".","Inspired","from","the","paper",":","PatrickStar",":","Parallel","Training","of","Pre-trained","Models","via","Chunk-based","Memory","Management","https",":","\/\/arxiv.org\/abs\/2108.05818"]
code: def move_to(self, device: Union[torch.device, int]):
      assert (
          self.state is not TensorState.FREE
      ), "Can't move free stateful tensor"
  
      if not isinstance(device, torch.device):
          to_device = torch.device("cuda", device)
      else:
          to_device = device
  
      from_device_type = self.device.type
      if from_device_type == to_device.type:
          # from device == to device
          return
  
      # update manager's information
      self.__trans_device_update(from_device_type, to_device.type)
      self.payload.data = self.payload.data.to(to_device)
  
imports: from enum import Enum
  from typing import Optional, Union
  import torch
  from .gemini_context import GeminiMemoryManager
label_desc: Use image node_id 6 for calling the StatefulTensor obj's underlying member method code with example usage: obj.move_to(device) without return types