Skip to content

Fix bug with Intel GPUs. #47

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ __pycache__/
*$py.class

.DS_Store
test.py
.gitignore
input.wav
output.wav
8 changes: 7 additions & 1 deletion rvc/lib/infer_pack/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ def forward(self, f0: torch.Tensor, upp: int):
output uv: tensor(batchsize=1, length, 1)
"""
with torch.no_grad():
device = next(self.parameters(), None)
if device is not None:
device = device.device
else:
device = f0.device
align_corners = device.type != "xpu"
f0 = f0[:, None].transpose(1, 2)
f0_buf = torch.zeros(f0.shape[0], f0.shape[1], self.dim, device=f0.device)
# fundamental component
Expand All @@ -412,7 +418,7 @@ def forward(self, f0: torch.Tensor, upp: int):
tmp_over_one.transpose(2, 1),
scale_factor=float(upp),
mode="linear",
align_corners=True,
align_corners=align_corners,
).transpose(2, 1)
rad_values = F.interpolate(
rad_values.transpose(2, 1), scale_factor=float(upp), mode="nearest"
Expand Down