Skip to content

Commit

Permalink
Remove args and kwargs from AffineQuantizedTensor
Browse files Browse the repository at this point in the history
Summary:
att

Test Plan:
python test/quantization/test_quant_api.py

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
jerryzh168 committed May 16, 2024
1 parent cda787c commit a39cb87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions torchao/quantization/subclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,18 +670,18 @@ def __new__(
quant_max: Optional[int] = None,
zero_point_domain: ZeroPointDomain = ZeroPointDomain.INT,
dtype=None,
# TODO: remove args and kwargs
*args,
**kwargs
strides=None,
):
kwargs = {}
kwargs["device"] = int_data.device
kwargs["layout"] = (
kwargs.get("layout") if kwargs.get("layout", False) else int_data.layout
)
if dtype is None:
dtype = scale.dtype
kwargs["dtype"] = dtype
assert not kwargs.get("requires_grad", False)
if strides is not None:
kwargs["strides"] = strides
kwargs["requires_grad"] = False
return torch.Tensor._make_wrapper_subclass(cls, shape, **kwargs) # type: ignore[attr-defined]

Expand All @@ -696,8 +696,7 @@ def __init__(
quant_max: Optional[int] = None,
zero_point_domain: ZeroPointDomain = ZeroPointDomain.INT,
dtype=None,
*args,
**kwargs
strides=None,
):
self.int_data = int_data
self.scale = scale
Expand Down Expand Up @@ -912,6 +911,7 @@ def _apply_fn_to_data(self, fn):
self.quant_max,
self.zero_point_domain,
dtype=self.dtype,
strides=self.stride(),
)

@classmethod
Expand Down

0 comments on commit a39cb87

Please sign in to comment.