class_docstr: A process-wide object that allocates large chunks of shared memory and partitions it into individual bytes.
  
  Note: this process is only responsible for bulk allocation, it does not manage/free unused bytes.
  The chunks are deallocated by the garbage collector,
  when it detects that all processes no longer use any bytes from this chunk.
class_docstr_tok: ["A","process-wide","object","that","allocates","large","chunks","of","shared","memory","and","partitions","it","into","individual","bytes",".","Note",":","this","process","is","only","responsible","for","bulk","allocation",",","it","does","not","manage\/free","unused","bytes",".","The","chunks","are","deallocated","by","the","garbage","collector",",","when","it","detects","that","all","processes","no","longer","use","any","bytes","from","this","chunk","."]
docstr: Create another shared byte value, represented as a scalar uint8 tensor
code: def next(cls) -> torch.Tensor:
      """Create another shared byte value, represented as a scalar uint8 tensor"""
      with cls._lock:
          if (
              cls._pid != os.getpid()
              or cls._buffer is None
              or cls._index >= len(cls._buffer)
          ):
              buffer_size = int(
                  os.environ.get("HIVEMIND_SHM_BUFFER_SIZE", 16)
              )
              cls._pid = os.getpid()
              cls._buffer = torch.empty(
                  [buffer_size], dtype=torch.uint8
              ).share_memory_()
              cls._index = 0
  
          cls._index += 1
          return cls._buffer[cls._index - 1]
  
imports: from __future__ import annotations
  import asyncio
  import concurrent.futures._base
  import multiprocessing
  import os
  import threading
  import uuid
  from contextlib import nullcontext
  from enum import Enum, auto
  from multiprocessing.reduction import ForkingPickler
  from typing import Any, Callable, Dict, Generic, Optional, TypeVar
  from weakref import ref
  import torch
  from hivemind.utils.logging import get_logger
label_desc: Use image node_id 1 for calling the SharedBytes obj's underlying member method code with example usage: obj.next(cls) and returns: cls