Skip to content

Instantly share code, notes, and snippets.

@shunting314
Created December 30, 2025 07:45
Show Gist options
  • Select an option

  • Save shunting314/79d6231702d785650631931c5b447314 to your computer and use it in GitHub Desktop.

Select an option

Save shunting314/79d6231702d785650631931c5b447314 to your computer and use it in GitHub Desktop.
import torch
x = torch.randn(1024, device="cuda")
g = torch.cuda.CUDAGraph()
with torch.cuda.graph(g):
v = x[0].item()
y = x + 1
print(g.pool())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment