Skip to content

Commit

Permalink
Avoid using .view(dtype) because ExecuTorch doesn't have that op (pyt…
Browse files Browse the repository at this point in the history
…orch#386)

Summary: As titled

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
larryliu0820 authored and malfet committed Jul 17, 2024
1 parent 7be5645 commit a306139
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def forward(self, indices: torch.Tensor) -> torch.Tensor:
weight_odd = self.weight.remainder(16)
weight_unpacked = torch.stack((weight_even, weight_odd), dim=-1)
weight = weight_unpacked.view(self.weight.shape[0], -1)
weight = weight.view(torch.int8).add(-8)
weight = weight.to(torch.int8).add(-8)
else:
weight = self.weight

Expand Down

0 comments on commit a306139

Please sign in to comment.