Skip to content

Instantly share code, notes, and snippets.

@apivovarov
Created August 23, 2024 21:47
Show Gist options
  • Save apivovarov/bbaf7d595449f3d2f3565e776d1a8d23 to your computer and use it in GitHub Desktop.
Save apivovarov/bbaf7d595449f3d2f3565e776d1a8d23 to your computer and use it in GitHub Desktop.
[torch_xla] convert hlo.pb to text hlo
import torch_xla.core.xla_builder as xb
fname = "model.hlo.pb"
with open(fname, mode="rb") as f:
comp = xb.computation_from_module_proto("foo", f.read())
print(xb.get_computation_hlo(comp))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment