Skip to content

Commit

Permalink
Add repr method on tensor subclass
Browse files Browse the repository at this point in the history
Differential Revision: D58786586

Pull Request resolved: #397
  • Loading branch information
tugsbayasgalan authored Jun 19, 2024
1 parent f5b6ec9 commit ea71549
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions torchao/dtypes/aqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ def _apply_fn_to_data(self, fn):
self.scale_and_zero = fn(self.scale_and_zero)
return self

def __repr__(self):
int_data, scale, zero_point = self.get_plain()
return f"TensorCoreTiledAQTLayout(int_data={int_data}, scale={scale}, zero_point={zero_point})"

@classmethod
def __torch_dispatch__(cls, func, types, args, kwargs):
kwargs = {} if kwargs is None else kwargs
Expand Down

0 comments on commit ea71549

Please sign in to comment.