code: def __iter__(self) -> Iterator[torch.Tensor]:
      for _, file in self.datapipe:
          try:
              read = functools.partial(fromfile, file, byte_order="big")
  
              magic = int(read(dtype=torch.int32, count=1))
              dtype = self._DTYPE_MAP[magic // 256]
              ndim = magic % 256 - 1
  
              num_samples = int(read(dtype=torch.int32, count=1))
              shape = (
                  cast(
                      List[int],
                      read(dtype=torch.int32, count=ndim).tolist(),
                  )
                  if ndim
                  else []
              )
              count = prod(shape) if shape else 1
  
              start = self.start or 0
              stop = (
                  min(self.stop, num_samples)
                  if self.stop
                  else num_samples
              )
  
              if start:
                  num_bytes_per_value = (
                      torch.finfo
                      if dtype.is_floating_point
                      else torch.iinfo
                  )(dtype).bits // 8
                  file.seek(num_bytes_per_value * count * start, 1)
  
              for _ in range(stop - start):
                  yield read(dtype=dtype, count=count).reshape(shape)
          finally:
              file.close()
  
imports: import abc
  import functools
  import operator
  import pathlib
  import string
  from typing import Any, BinaryIO, cast, Dict, Iterator, List, Optional, Sequence, Tuple, Union
  import torch
  from torchdata.datapipes.iter import Decompressor, Demultiplexer, IterDataPipe, Mapper, Zipper
  from torchvision.prototype.datasets.utils import Dataset, HttpResource, OnlineResource
  from torchvision.prototype.datasets.utils._internal import hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE
  from torchvision.prototype.tv_tensors import Label
  from torchvision.prototype.utils._internal import fromfile
  from torchvision.tv_tensors import Image
  from .._api import register_dataset, register_info
label_desc: Use image node_id 2 for calling the MNISTFileReader obj's underlying member method code with example usage: obj.__iter__() without return types