Skip to content

Add DirectML support#177

Open
Looong01 wants to merge 2 commits intochenfei-wu:dependabot/pip/torch-1.13.1from
Looong01:DirectML
Open

Add DirectML support#177
Looong01 wants to merge 2 commits intochenfei-wu:dependabot/pip/torch-1.13.1from
Looong01:DirectML

Conversation

@Looong01
Copy link

You can create a new branch to save this.

@Looong01
Copy link
Author

@microsoft-github-policy-service agree

@dependabot dependabot bot force-pushed the dependabot/pip/torch-1.13.1 branch from 486465f to ad394e1 Compare March 15, 2023 06:06
@ezioruan
Copy link
Contributor

Awesome. Really need this

def __init__(self, device):
print("Initializing ScribbleText2Image to %s" % device)
self.torch_dtype = torch.float16 if 'cuda' in device else torch.float32
if isinstance(device, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

you can refractor these duplicate lines into a function

def get_touch_dtype(device):
    if isinstance(device, str):
            torch_dtype = torch.float16 if 'cuda' in device else torch.float32
        else:
            torch_dtype = torch.float32
        return torch_dtype

Copy link
Contributor

@ezioruan ezioruan left a comment

Choose a reason for hiding this comment

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

Thank you for adding this amazing feature. There is some high code repetition inside, it would be even better if it could be addressed.

@Looong01
Copy link
Author

Thank you for adding this amazing feature. There is some high code repetition inside, it would be even better if it could be addressed.

Revised.

@Looong01
Copy link
Author

Looong01 commented Mar 21, 2023

Thank you for adding this amazing feature. There is some high code repetition inside, it would be even better if it could be addressed.

Hey, would you like to merge these codes? I have revised my codes under your criterion.

@ezioruan
Copy link
Contributor

Thank you for adding this amazing feature. There is some high code repetition inside, it would be even better if it could be addressed.

Hey, would you like to merge these codes? I have revised my codes under your criterion.

I don't have the permission to do that, maybe ask the project owner

@Looong01
Copy link
Author

@shengming-yin @BinayakJha @chenfei-wu Could you please merge this branch? This can help the users run it on Windows with AMD & Intel GPUs.

@Looong01
Copy link
Author

@Wang-Xiaodong1899 @CODINNLG @rupeshs @bojieli @heysujal @WeizhenQ Could you please merge this branch? This can help the users run it on Windows with AMD & Intel GPUs.

@heysujal
Copy link
Contributor

@Wang-Xiaodong1899 @CODINNLG @rupeshs @bojieli @heysujal @WeizhenQ Could you please merge this branch? This can help the users run it on Windows with AMD & Intel GPUs.

Hi , sorry but I am not the maintainer of the project

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.

4 participants