File tree Expand file tree Collapse file tree 8 files changed +18
-12
lines changed Expand file tree Collapse file tree 8 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 6
6
from multiprocessing import cpu_count
7
7
8
8
import torch
9
-
10
- try :
11
- import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
12
-
13
- if torch .xpu .is_available ():
14
- from infer .modules .ipex import ipex_init
15
-
16
- ipex_init ()
17
- except Exception : # pylint: disable=broad-exception-caught
18
- pass
9
+ # TODO: move device selection into rvc
19
10
import logging
20
11
21
12
logger = logging .getLogger (__name__ )
Original file line number Diff line number Diff line change 24
24
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
25
25
26
26
if torch .xpu .is_available ():
27
- from infer .modules .ipex import ipex_init
28
- from infer .modules .ipex .gradscaler import gradscaler_init
27
+ from rvc .ipex import ipex_init , gradscaler_init
29
28
from torch .xpu .amp import autocast
30
29
31
30
GradScaler = gradscaler_init ()
Original file line number Diff line number Diff line change
1
+ from . import ipex
2
+ import sys
3
+ del sys .modules ["rvc.ipex" ]
4
+
Original file line number Diff line number Diff line change
1
+ try :
2
+ import torch
3
+ if torch .xpu .is_available ():
4
+ from .init import ipex_init
5
+ ipex_init ()
6
+ from .gradscaler import gradscaler_init
7
+ except Exception : # pylint: disable=broad-exception-caught
8
+ pass
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
from collections import defaultdict
2
+
2
3
import torch
3
4
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
4
5
import intel_extension_for_pytorch ._C as core # pylint: disable=import-error, unused-import
Original file line number Diff line number Diff line change 1
1
import contextlib
2
2
import importlib
3
+
3
4
import torch
4
5
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
5
6
Original file line number Diff line number Diff line change 1
1
import os
2
2
import sys
3
3
import contextlib
4
+
4
5
import torch
5
6
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
7
+
6
8
from .hijacks import ipex_hijacks
7
9
from .attention import attention_init
8
10
You can’t perform that action at this time.
0 commit comments