def cache(
        self, dataloader: _Iterable, nsamples: int, device: str
    ) -> _Tuple[_List[_torch.Tensor], _Dict[str, _torch.Tensor]]:
        """
        Cache inputs and keyword arguments to be fed to first layer of the model
        which is set up for compression.

        Args:
            dataloader (:py:class:`Iterable`): An iterable where each element
                is an input to the model to be compressed.
            nsamples (:obj:`int`): Number of samples to cache.
            device (:obj:`str`): Device string for device to run compression on.
        """
        raise NotImplementedError("Method not implemented in base class.")

        Cache inputs and keyword arguments to be fed to first layer of the model
        which is set up for compression.

        Args:
            dataloader (:py:class:`Iterable`): An iterable where each element
                is an input to the model to be compressed.
            nsamples (:obj:`int`): Number of samples to cache.
            device (:obj:`str`): Device string for device to run compression on.
        
coremltools/optimize/torch/layerwise_compression/input_cacher.py