Skip to content

Commit

Permalink
Fixed an issue that the spatial mapping saved in the output json coul…
Browse files Browse the repository at this point in the history
…d be incorrect.
  • Loading branch information
JiacongSun committed Feb 6, 2024
1 parent 43d743d commit 4fb6eb0
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions zigzag/classes/stages/SpatialMappingConversionStage.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,6 @@ def run(self):
spatial_mapping, spatial_mapping_int = self.convert_user_spatial_mapping(
user_spatial_mapping
)
# Since the spatial_mapping may be modified in the previous step,
# we have to update this change to self.layer
updated_user_spatial_mapping = {}
for oa_dim, sm_loop in user_spatial_mapping.items():
if self.is_nested_tuple(sm_loop): # a mix sm loop
sm_comb = []
for sub_sm_loop in sm_loop:
sm_layer_dim = sub_sm_loop[0]
for sm_element in spatial_mapping.spatial_loop_dim_size:
if sm_element[0] == sm_layer_dim:
sm_comb.append(sm_element)
sm_comb = tuple(sm_comb)
updated_user_spatial_mapping[oa_dim] = sm_comb
else:
sm_layer_dim = sm_loop[0]
for sm_element in spatial_mapping.spatial_loop_dim_size:
if sm_element[0] == sm_layer_dim:
updated_user_spatial_mapping[oa_dim] = sm_element
self.layer.user_spatial_mapping = updated_user_spatial_mapping

kwargs = self.kwargs.copy()
kwargs["spatial_mapping"] = spatial_mapping
Expand Down

0 comments on commit 4fb6eb0

Please sign in to comment.