diff --git a/nncf/common/utils/dot_file_rw.py b/nncf/common/utils/dot_file_rw.py index 9b50ea48a57..2e4b584ea6e 100644 --- a/nncf/common/utils/dot_file_rw.py +++ b/nncf/common/utils/dot_file_rw.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +import copy import pathlib from collections import defaultdict @@ -52,6 +52,8 @@ def relabel_graph_for_dot_visualization(nx_graph: nx.Graph, from_reference: bool :return: NetworkX graph with reserved symbols in nodes keys replaced. """ + nx_graph = copy.deepcopy(nx_graph) + # .dot format reserves ':' character in node names if not from_reference: # dumping to disk