keras/src/backend/tensorflow/layer.py/TFLayer/_trackable_children
class TFLayer:    def _trackable_children(self, save_type="checkpoint", **kwargs):
        if save_type == "savedmodel":
            # SavedModel needs to ignore the execution functions.
            train_function = getattr(self, "train_function", None)
            test_function = getattr(self, "test_function", None)
            predict_function = getattr(self, "predict_function", None)
            self.train_function = None
            self.test_function = None
            self.predict_function = None

        children = super()._trackable_children(save_type, **kwargs)

        if save_type == "savedmodel":
            self.train_function = train_function
            self.test_function = test_function
            self.predict_function = predict_function

            for tracked_attr in self._tracked:
                tracked_item = getattr(self, tracked_attr)
                if isinstance(tracked_item, tracking.TrackedList):
                    children[tracked_attr] = list(tracked_item)
                if isinstance(tracked_item, tracking.TrackedDict):
                    children[tracked_attr] = dict(tracked_item)
                if isinstance(tracked_item, tracking.TrackedSet):
                    children[tracked_attr] = list(tracked_item)

        return children