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_relay(self, rhs):
      # relay the payload of rhs to current stateful tensor
      # can't support null relay right now
      assert not rhs.is_null()
  
      # now this function only support stateful tensor that has zero-length payload
      # because it doesn't require memory manager updating
      # you can extend this function by yourself
      assert self.payload_size == 0
  
      self._payload = rhs.payload
      self._payload_size = rhs.payload_size
      self._state = TensorState.HOLD
      self.__trans_state_update(rhs.state, TensorState.HOLD)
  
      rhs.__release()
  
imports: from enum import Enum
  from typing import Optional, Union
  import torch
  from .gemini_context import GeminiMemoryManager
label_desc: Use image node_id 9 for calling the StatefulTensor obj's underlying member method code with example usage: obj.payload_relay(rhs) without return types