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

        :return: State dictionary with instance parameters.
        """
        state = self.__dict__.copy()

        # Remove the unpicklable entries
        del state["_sess"]
        del state["_input_ph"]
        state["_output"] = self.output.name

        if self.labels_ph is not None:
            state["_labels_ph"] = self.labels_ph.name

        if self._loss is not None:
            state["_loss"] = self._loss.name

        if hasattr(self, "_loss_grads"):
            state["_loss_grads"] = self._loss_grads.name
        else:
            state["_loss_grads"] = False

        if self.learning is not None:
            state["_learning"] = self.learning.name

        if self.train is not None:
            state["_train"] = self.train.name

        if hasattr(self, "_class_grads"):
            state["_class_grads"] = [ts if ts is None else ts.name for ts in self._class_grads]
        else:
            state["_class_grads"] = False

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

        return state

        Use to ensure `TensorFlowClassifier` can be pickled.

        :return: State dictionary with instance parameters.
        
art/estimators/classification/tensorflow.py