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 payload_reset(self, tensor) -> None:
      assert (
          tensor is not None
      ), "Can't reset None for stateful tensors, please use set_null() instead"
  
      if self.payload is not None:
          # release old payload
          self.__trans_state_update(self.state, TensorState.FREE)
      else:
          # otherwise, set the state to HOLD for new payload
          self._state = TensorState.HOLD
      del self._payload
  
      self._payload = tensor
      self._payload_size = sizeof_tensor(tensor)
      # record new payload
      self.__trans_state_update(TensorState.FREE, self.state)
  
imports: from enum import Enum
  from typing import Optional, Union
  import torch
  from .gemini_context import GeminiMemoryManager
label_desc: Use image node_id 8 for calling the StatefulTensor obj's underlying member method code with example usage: obj.payload_reset(tensor) without return types