Skip to content

Commit d1ac789

Browse files
Add repr method on tensor subclass
ghstack-source-id: f644a8d Pull Request resolved: #397
1 parent f5b6ec9 commit d1ac789

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

torchao/dtypes/aqt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ def _apply_fn_to_data(self, fn):
480480
self.scale_and_zero = fn(self.scale_and_zero)
481481
return self
482482

483+
def __repr__(self):
484+
int_data, scale, zero_point = self.get_plain()
485+
return f"TensorCoreTiledAQTLayout(int_data={int_data}, scale={scale}, zero_point={zero_point})"
486+
483487
@classmethod
484488
def __torch_dispatch__(cls, func, types, args, kwargs):
485489
kwargs = {} if kwargs is None else kwargs

0 commit comments

Comments
 (0)