keras/src/utils/tracking.py/TrackedDict/clear
class TrackedDict:    def clear(self):
        if self.tracker:
            for value in self.values():
                self.tracker.untrack(value)
        super().clear()