def to_torch(
        self,
        get_item,
        vectorize=False,
        skip_failures=False,
        local_process_group=None,
    ):
        """Constructs a :class:`torch:torch.utils.data.Dataset` that loads data
        from this collection via the provided
        :class:`fiftyone.utils.torch.GetItem` instance.

        Args:
            get_item: a :class:`fiftyone.utils.torch.GetItem`
            vectorize (False): whether to load and cache the required fields
                from the sample collection upfront (True) or lazily load the
                values from each sample when items are retrieved (False).
                Vectorizing gives faster data loading times, but you must have
                enough memory to store the required field values for the entire
                sample collection. When ``vectorize=True``, all field values
                must be serializable; ie ``pickle.dumps(field_value)`` must not
                raise an error
            skip_failures (False): whether to skip failures that occur when
                calling ``get_item``. If True, the exception will be returned
                rather than the intended field values
            local_process_group (None): the local process group. Only used
                during distributed training

        Returns:
            a :class:`torch:torch.utils.data.Dataset`
        """
        from fiftyone.utils.torch import FiftyOneTorchDataset

        return FiftyOneTorchDataset(
            self,
            get_item,
            vectorize=vectorize,
            skip_failures=skip_failures,
            local_process_group=local_process_group,
        )
Constructs a :class:`torch:torch.utils.data.Dataset` that loads data
        from this collection via the provided
        :class:`fiftyone.utils.torch.GetItem` instance.

        Args:
            get_item: a :class:`fiftyone.utils.torch.GetItem`
            vectorize (False): whether to load and cache the required fields
                from the sample collection upfront (True) or lazily load the
                values from each sample when items are retrieved (False).
                Vectorizing gives faster data loading times, but you must have
                enough memory to store the required field values for the entire
                sample collection. When ``vectorize=True``, all field values
                must be serializable; ie ``pickle.dumps(field_value)`` must not
                raise an error
            skip_failures (False): whether to skip failures that occur when
                calling ``get_item``. If True, the exception will be returned
                rather than the intended field values
            local_process_group (None): the local process group. Only used
                during distributed training

        Returns:
            a :class:`torch:torch.utils.data.Dataset`
        
fiftyone/core/collections.py