PR #43417: Fixes #42872: map_to_outputs_names always returns a copy
PR #43417: Fixes #42872: map_to_outputs_names always returns a copy

Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/43417

This PR always returns a copy to ensure that any change made to `struct` after calling this function does not propagate to the original `struct` which leads t...

PiperOrigin-RevId: 380211940

keras-team/keras,keras-team/keras