def _strip_variable_names(self, summaries):
        """Remove `variable_n` from summary tag

        `variable_n` tag names are added with random numbers. Removing them
        ensures deterministic tag names.

        Args:
            summaries: A `set` of `_ObservedSummary` values.

        Returns:
            A new `set` of `_ObservedSummary` values with layer prefixes
            removed.
        """
        result = set()
        for s in summaries:
            if "/" not in s.tag:
                result.add(s)
            else:
                split_tag = s.tag.split("/")
                if "variable" in split_tag[0]:
                    result.add(s._replace(tag=split_tag[-1]))
                else:
                    result.add(s)
        return result
Remove `variable_n` from summary tag

        `variable_n` tag names are added with random numbers. Removing them
        ensures deterministic tag names.

        Args:
            summaries: A `set` of `_ObservedSummary` values.

        Returns:
            A new `set` of `_ObservedSummary` values with layer prefixes
            removed.
        
keras/src/callbacks/tensorboard_test.py