Skip to content

Commit

Permalink
Use default method in stablehlo txt/bytecode getter of StableHLOGraph…
Browse files Browse the repository at this point in the history
…Module (pytorch#5745)

Co-authored-by: Siyuan Liu <[email protected]>
  • Loading branch information
2 people authored and chunnienc committed Dec 14, 2023
1 parent 9a51ab5 commit 5c481db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions torch_xla/stablehlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ def evaluate(self, method_name, args):
res = pytree.tree_unflatten(res, out_spec)
return res

def get_stablehlo_bytecode(self, method_name):
def get_stablehlo_bytecode(self, method_name=None):
if method_name is None:
method_name = self._default_method
return self._name_to_stablehlo[method_name].bytecode

def get_stablehlo_text(self, method_name):
def get_stablehlo_text(self, method_name=None):
if method_name is None:
method_name = self._default_method
return self._name_to_stablehlo[method_name].text

def save(self, directory_path):
Expand Down

0 comments on commit 5c481db

Please sign in to comment.