def _get_cached_inputs(
        self, dataloader: _Iterable, device: str
    ) -> _Tuple[_List[_torch.Tensor], _Dict[str, _torch.Tensor]]:
        """
        Cache the inputs and keyword arguments up till the first layer set up for compression
        """
        inputs, kwarg_inputs = self._input_cacher.cache(
            dataloader=dataloader,
            nsamples=self._config.calibration_nsamples,
            device=device,
        )
        return inputs, kwarg_inputs

        Cache the inputs and keyword arguments up till the first layer set up for compression
        
coremltools/optimize/torch/layerwise_compression/layerwise_compressor.py