def to_numpy(self) -> NumpyT:
        """Convert the batch to a NumpyBatch object.

        Returns:
            NumpyT: The converted numpy batch object.
        """
        batch_dict = asdict(self)
        for key, value in batch_dict.items():
            if isinstance(value, torch.Tensor):
                batch_dict[key] = value.cpu().numpy()
        return self.numpy_class(
            **batch_dict,
        )
Convert the batch to a NumpyBatch object.

        Returns:
            NumpyT: The converted numpy batch object.
        
src/anomalib/data/dataclasses/torch/base.py