8000 Make numpy check optional (#149356) · pytorch/pytorch@f0e7257 · GitHub 65F7
[go: up one dir, main page]

Skip to content

Commit f0e7257

Browse files
atalmanpytorchbot
authored andcommitted
Make numpy check optional (#149356)
We may want to skip numpy smoke tests. Hence making it optional Pull Request resolved: #149356 Approved by: https://github.com/ZainRizvi (cherry picked from commit 6e2b266)
1 parent 1a3161a commit f0e7257

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.ci/pytorch/smoke_test/smoke_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ def read_release_matrix():
7676

7777

7878
def test_numpy():
79-
import numpy as np
79+
try:
80+
import numpy as np
8081

81-
x = np.arange(5)
82-
torch.tensor(x)
82+
x = np.arange(5)
83+
torch.tensor(x)
84+
except ImportError:
85+
print("Numpy check skipped. Numpy is not installed.")
8386

8487

8588
def check_version(package: str) -> None:
@@ -410,6 +413,7 @@ def main() -> None:
410413
smoke_test_conv2d()
411414
test_linalg()
412415
test_numpy()
416+
413417
if is_cuda_system:
414418
test_linalg("cuda")
415419
test_cuda_gds_errors_captured()

0 commit comments

Comments
 (0)
0