def __getstate__(self) -> dict[str, Any]:
        """
        Use to ensure `PyTorchRegressor` can be pickled.

        :return: State dictionary with instance parameters.
        """

        # disable pylint because access to _model required
        state = self.__dict__.copy()
        state["inner_model"] = copy.copy(state["_model"]._model)

        # Remove the unpicklable entries
        del state["_model_wrapper"]
        del state["_device"]
        del state["_model"]

        model_name = str(time.time())
        state["model_name"] = model_name
        self.save(model_name)

        return state

        Use to ensure `PyTorchRegressor` can be pickled.

        :return: State dictionary with instance parameters.
        
art/estimators/regression/pytorch.py