Skip to content

Commit

Permalink
Fixed input encodings export of Concat module (#3702)
Browse files Browse the repository at this point in the history
Signed-off-by: Chetan Gulecha <[email protected]>
  • Loading branch information
quic-cgulecha authored Dec 31, 2024
1 parent afc7f52 commit c8c0e24
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
# =============================================================================
""" Quantized definitions for custom modules of AIMET """

import copy
from typing import Optional
import torch
from torch import Tensor
Expand Down Expand Up @@ -141,7 +142,8 @@ def export_input_encodings(self, encoding_version: str):
Extends super().export to repeat input quantizer's encodings :attr:`self._num_inputs` times
"""
input_encodings = super().export_input_encodings(encoding_version)
return input_encodings * self._num_inputs
# Create separate encoding objects to avoid overriding of attributes added/updated later while exporting encodings
return [copy.deepcopy(encoding) for encoding in input_encodings * self._num_inputs]

def import_input_encodings(self,
encodings,
Expand Down

0 comments on commit c8c0e24

Please sign in to comment.