class_docstr: Torch datasource, for reading from `Torch
  datasets <https://pytorch.org/docs/stable/data.html/>`_.
  This datasource implements a streaming read using a single read task.
class_docstr_tok: ["Torch","datasource",",","for","reading","from","`","Torch","datasets","<","https",":","\/\/pytorch.org\/docs\/stable\/data.html\/",">","`","_",".","This","datasource","implements","a","streaming","read","using","a","single","read","task","."]
code: def get_read_tasks(self, parallelism):
      assert parallelism == 1
  
      meta = BlockMetadata(
          num_rows=len(self._dataset),
          size_bytes=None,
          schema=None,
          input_files=None,
          exec_stats=None,
      )
      read_task = ReadTask(
          lambda subset=self._dataset: _read_subset(
              subset,
          ),
          metadata=meta,
      )
  
      return [read_task]
  
file_path: ray/python/ray/data/datasource/torch_datasource.py
imports: from typing import TYPE_CHECKING
  from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
  from ray.data.block import BlockMetadata
  from ray.data.datasource.datasource import Datasource, ReadTask
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 2 for calling the TorchDatasource obj's underlying member method code with example usage: obj.get_read_tasks(parallelism) and returns: list