Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomlago committed Jan 13, 2025
1 parent 82287b0 commit c599f31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/brevitas/graph/equalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,9 @@ def _apply_rotate(
continue

# Cast rotation matrix to the weight dtype
dtype = next(model.parameters()).dtype
rot_mat = rot_mat.to(dtype=dtype)
if rot_mat is not None:
dtype = next(model.parameters()).dtype
rot_mat = rot_mat.to(dtype=dtype)
# If the rotation is not fused, redefine as a Parameter, to enable its optimization
if not insert_rotation_module and not fuse_rotations:
rot_mat = torch.nn.Parameter(rot_mat)
Expand Down

0 comments on commit c599f31

Please sign in to comment.