Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomlago committed Jan 14, 2025
1 parent 18fff54 commit b1b59a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/brevitas/graph/equalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ def _apply_rotate(
# Only "weight" is rotated
tensor_names_axis = [("weight", _get_input_axis(module))]
# If rotations are fused or if the module is an orphan sink, transform is applied directly onto the tensor
rewriter_class = ModuleInstanceRegisterParametrization if insert_rotation_module or fuse_rotations else ModuleInstanceRegisterParametrization
rewriter_class = ModuleInstanceTransformTensor if insert_rotation_module or fuse_rotations else ModuleInstanceRegisterParametrization
# Obtain rewriters for applying the rotations
for tensor_name, axis in tensor_names_axis:
rewriter = rewriter_class(
Expand Down
3 changes: 2 additions & 1 deletion tests/brevitas/graph/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ def forward(self, x):
model_unfused.linear.weight.data = model_fused.linear.weight.data

model_fused = ModuleInstanceTransformTensor(
model_fused.linear, "weight", rot_mat, rot_func, None, axis).apply(model_fused)
model_fused.linear, "weight", RotationWeightParametrization(rot_mat, rot_func, axis,
None)).apply(model_fused)
model_unfused = ModuleInstanceRegisterParametrization(
model_unfused.linear,
"weight",
Expand Down

0 comments on commit b1b59a2

Please sign in to comment.