From a3061396b3777919bb1dbf3db318ce0a68bb17a7 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Mon, 22 Apr 2024 19:07:32 -0700 Subject: [PATCH] Avoid using .view(dtype) because ExecuTorch doesn't have that op (#386) Summary: As titled Test Plan: Reviewers: Subscribers: Tasks: Tags: --- quantize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantize.py b/quantize.py index 635d473f69..04364fe801 100644 --- a/quantize.py +++ b/quantize.py @@ -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