Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove tpc from graph object saved in the output pytorch model #1310

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
import copy
from abc import abstractmethod
from functools import partial
from typing import Tuple, Any, Dict, List, Union, Callable
from typing import Tuple, Any, Dict, List, Callable

import torch
import numpy as np
Expand All @@ -30,7 +31,6 @@
from model_compression_toolkit.core.common.user_info import UserInformation
from model_compression_toolkit.core.pytorch.back2framework.instance_builder import node_builder
from model_compression_toolkit.core.pytorch.default_framework_info import DEFAULT_PYTORCH_INFO
from model_compression_toolkit.core.pytorch.pytorch_device_config import get_working_device
from model_compression_toolkit.core.pytorch.reader.node_holders import DummyPlaceHolder
from model_compression_toolkit.core.pytorch.utils import to_torch_tensor
from mct_quantizers.common.constants import ACTIVATION_HOLDER_QUANTIZER
Expand Down Expand Up @@ -224,8 +224,10 @@ def __init__(self,

"""
super(PytorchModel, self).__init__()
self.graph = graph
self.node_sort = list(topological_sort(graph))
self.graph = copy.deepcopy(graph)
delattr(self.graph, 'tpc')

self.node_sort = list(topological_sort(self.graph))
self.node_to_activation_quantization_holder = {}
self.append2output = append2output
self.return_float_outputs = return_float_outputs
Expand Down
Loading