class_docstr: The way Determined shards a dataset for distributed training and then gathers predictions in
  custom reducers does not maintain dataset ordering.  Here, we include the index in the dataset
  so that predictions can be sorted correctly at evaluation time.
class_docstr_tok: ["The","way","Determined","shards","a","dataset","for","distributed","training","and","then","gathers","predictions","in","custom","reducers","does","not","maintain","dataset","ordering",".","Here",",","we","include","the","index","in","the","dataset","so","that","predictions","can","be","sorted","correctly","at","evaluation","time","."]
code: def __init__(self, dataset: torch.utils.data.Dataset):
      self.dataset = dataset
  
imports: import functools
  import logging
  import math
  import os
  from typing import Any, Iterator, List, Tuple
  import filelock
  import mmcv
  import mmcv.parallel
  import mmdet.datasets
  import numpy
  import torch
  import torch.utils.data
  import determined.pytorch
label_desc: Use image node_id 1 to create a new DatasetWithIndex object from inherited base classes: torch.utils.data with example: obj = DatasetWithIndex(dataset)