Skip to content

Conversation

@NiklasGustafsson
Copy link
Contributor

Fixes #1317

{
device = get_default_device();
}
device = torch.InitializeDevice(device);
Copy link
Contributor

@yueyinqiu yueyinqiu Jun 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we shall modify the behavior of torch.InitializeDevice(null) as well?

(And then it is no need to

if (device is null)
{
    device = get_default_device();
}

)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

@NiklasGustafsson NiklasGustafsson merged commit 6bdf60b into dotnet:main Jun 3, 2024
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

Successfully merging this pull request may close these issues.

How to set default device type in torchsharp.

2 participants