code: def _wrap(
      cls: Type[L],
      tensor: torch.Tensor,
      *,
      categories: Optional[Sequence[str]],
  ) -> L:
      label_base = tensor.as_subclass(cls)
      label_base.categories = categories
      return label_base
  
file_path: vision/torchvision/prototype/tv_tensors/_label.py
imports: from __future__ import annotations
  from typing import Any, Optional, Sequence, Type, TypeVar, Union
  import torch
  from torch.utils._pytree import tree_map
  from torchvision.tv_tensors._tv_tensor import TVTensor
label_desc: Use image node_id 1 for calling the _LabelBase obj's underlying member method code with example usage: obj._wrap(cls, tensor) and returns: label_base