Skip to content

Commit

Permalink
[RUNTIME][INTERPRETER] now also override __str__ method for tensors (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
ptillet authored Sep 17, 2023
1 parent e686b4d commit 894fa9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/triton/runtime/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ def _patch_lang_tensor(tensor, builder):
patch_attr(tensor, name, member, builder)
tensor.__index__ = lambda self: int(self.handle.data)
tensor.__bool__ = lambda self: True
tensor.__str__ = lambda self: str(self.handle.data)
tensor.__getitem__ = lambda self, slices: self.handle.data.__getitem__(slices)


def _patch_lang_core(lang, builder):
Expand Down

0 comments on commit 894fa9e

Please sign in to comment.