code: def spatial_size(self) -> Tuple[int, int]:
      if not hasattr(self, "_spatial_size"):
          with PIL.Image.open(ReadOnlyTensorBuffer(self)) as image:
              self._spatial_size = image.height, image.width
  
      return self._spatial_size
  
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 EncodedImage obj's underlying member method code with example usage: obj.spatial_size() and returns: self