class_docstr: Base class for all TVTensors.
  
  You probably don't want to use this class unless you're defining your own
  custom TVTensors. See
  :ref:`sphx_glr_auto_examples_transforms_plot_custom_tv_tensors.py` for details.
class_docstr_tok: ["Base","class","for","all","TVTensors",".","You","probably","do","n't","want","to","use","this","class","unless","you","'re","defining","your","own","custom","TVTensors",".","See",":","ref",":","`","sphx_glr_auto_examples_transforms_plot_custom_tv_tensors.py","`","for","details","."]
code: def _wrap_output(
      cls,
      output: torch.Tensor,
      args: Sequence[Any] = (),
      kwargs: Optional[Mapping[str, Any]] = None,
  ) -> torch.Tensor:
      # Same as torch._tensor._convert
      if isinstance(output, torch.Tensor) and not isinstance(
          output, cls
      ):
          output = output.as_subclass(cls)
  
      if isinstance(output, (tuple, list)):
          # Also handles things like namedtuples
          output = type(output)(
              cls._wrap_output(part, args, kwargs) for part in output
          )
      return output
  
file_path: vision/torchvision/tv_tensors/_tv_tensor.py
imports: from __future__ import annotations
  from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union
  import torch
  from torch._C import DisableTorchFunctionSubclass
  from torch.types import _device, _dtype, _size
  from torchvision.tv_tensors._torch_function_helpers import _FORCE_TORCHFUNCTION_SUBCLASS, _must_return_subclass
label_desc: Use image node_id 2 for calling the TVTensor obj's underlying member method code with example usage: obj._wrap_output(cls, output, args, kwargs) and returns: output