Skip to content

Commit

Permalink
Add VariableTracker.debug_repr (#126299)
Browse files Browse the repository at this point in the history
Summary:
Now you can print arbitrary values at compile time with
comptime.print()

Signed-off-by: Edward Z. Yang <[email protected]>

X-link: pytorch/pytorch#126299
Approved by: https://github.com/jansel
ghstack dependencies: #126292

Reviewed By: huydhn

Differential Revision: D57421156

Pulled By: ezyang

fbshipit-source-id: a75045a564722baa243b1381a324bc9f6c061ff1
  • Loading branch information
ezyang authored and facebook-github-bot committed May 16, 2024
1 parent c7d12c1 commit 218fffe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2642,3 +2642,11 @@ def get_locals_to_steal(maybe_gm):

def set_locals_to_steal(gm, locals_to_steal):
gm.meta["locals_to_steal"] = locals_to_steal


class Lit:
def __init__(self, s):
self.s = s

def __repr__(self):
return self.s

0 comments on commit 218fffe

Please sign in to comment.