Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.inference_mode() not working with torch_directml device #602

Open
nagadomi opened this issue Jun 29, 2024 · 0 comments
Open

torch.inference_mode() not working with torch_directml device #602

nagadomi opened this issue Jun 29, 2024 · 0 comments

Comments

@nagadomi
Copy link

torch_directml==0.2.2.dev240614

import torch
import torch_directml

device = torch_directml.device()
model = torch.nn.Linear(3, 128).eval().to(device)
with torch.inference_mode():
    x = torch.zeros(4, 3).to(device)
    z = model(x)
RuntimeError: Cannot set version_counter for inference tensor

Using torch.no_grad() instead of torch.inference_mode() works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant