Skip to content

Commit b3397a6

Browse files
authored
remove torchvision dependency (#5381)
* remove torchvision dependency * format code
1 parent 4f92c49 commit b3397a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

intel_extension_for_pytorch/xpu/intrinsic/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .modules import EMA
77
from .modules import TransducerLoss, clip_grad_norm_, clip_grad_norm
88
import intel_extension_for_pytorch
9-
import torchvision
9+
1010

1111
__all__ = [
1212
"TransducerLoss",
@@ -38,6 +38,8 @@ def MulAdd(input, other, accumu, alpha=1.0):
3838

3939

4040
def nms(dets, scores, iou_threshold):
41+
import torchvision
42+
4143
return torchvision.ops.nms(dets, scores, iou_threshold)
4244

4345

@@ -55,6 +57,8 @@ def roi_align(
5557
sampling_ratio: int = -1,
5658
aligned: bool = False,
5759
) -> Tensor:
60+
import torchvision
61+
5862
return torchvision.ops.roi_align(
5963
input,
6064
boxes,

0 commit comments

Comments
 (0)