code: def _wrap(cls: Type[D], tensor: torch.Tensor) -> D:
      return tensor.as_subclass(cls)
  
file_path: vision/torchvision/prototype/datasets/utils/_encoded.py
imports: from __future__ import annotations
  import os
  import sys
  from typing import Any, BinaryIO, Optional, Tuple, Type, TypeVar, Union
  import PIL.Image
  import torch
  from torchvision.prototype.utils._internal import fromfile, ReadOnlyTensorBuffer
  from torchvision.tv_tensors._tv_tensor import TVTensor
label_desc: Use image node_id 1 for calling the EncodedData obj's underlying member method code with example usage: obj._wrap(cls, tensor) and returns: tensor