Spaces:
Paused
Paused
Upload 2 files
Browse files- test_installation.py +61 -61
test_installation.py
CHANGED
@@ -21,35 +21,35 @@ def test_imports():
|
|
21 |
print(f"β PyTorch import failed: {e}")
|
22 |
return False
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
try:
|
55 |
import nvdiffrast
|
@@ -78,39 +78,39 @@ def test_basic_functionality():
|
|
78 |
"""Test basic functionality of key components"""
|
79 |
print("\nTesting basic functionality...")
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
|
115 |
return True
|
116 |
|
|
|
21 |
print(f"β PyTorch import failed: {e}")
|
22 |
return False
|
23 |
|
24 |
+
# Check if torch-sparse is available or disabled
|
25 |
+
try:
|
26 |
+
import torch_sparse
|
27 |
+
print("β torch-sparse")
|
28 |
+
except ImportError:
|
29 |
+
# Check if torch-sparse was disabled
|
30 |
+
try:
|
31 |
+
with open("NeuralJacobianFields/PoissonSystem.py", 'r') as f:
|
32 |
+
content = f.read()
|
33 |
+
if "USE_TORCH_SPARSE = False" in content:
|
34 |
+
print("β torch-sparse (disabled, using built-in PyTorch sparse)")
|
35 |
+
else:
|
36 |
+
print("β torch-sparse (not available)")
|
37 |
+
return False
|
38 |
+
except:
|
39 |
+
print("β torch-sparse (not available)")
|
40 |
+
return False
|
41 |
+
except Exception as e:
|
42 |
+
print(f"β torch-sparse import failed: {e}")
|
43 |
+
return False
|
44 |
|
45 |
+
# Check if torch-scatter is available (not critical)
|
46 |
+
try:
|
47 |
+
import torch_scatter
|
48 |
+
print("β torch-scatter")
|
49 |
+
except ImportError:
|
50 |
+
print("β torch-scatter (not available, may not be critical)")
|
51 |
+
except Exception as e:
|
52 |
+
print(f"β torch-scatter import failed: {e} (may not be critical)")
|
53 |
|
54 |
try:
|
55 |
import nvdiffrast
|
|
|
78 |
"""Test basic functionality of key components"""
|
79 |
print("\nTesting basic functionality...")
|
80 |
|
81 |
+
try:
|
82 |
+
import torch
|
83 |
+
|
84 |
+
# Test basic tensor operations
|
85 |
+
x = torch.randn(10, 10)
|
86 |
+
y = torch.randn(10, 10)
|
87 |
+
z = x + y
|
88 |
+
print("β Basic tensor operations")
|
89 |
+
|
90 |
+
# Test sparse operations (using built-in PyTorch sparse)
|
91 |
+
indices = torch.randint(0, 10, (2, 20))
|
92 |
+
values = torch.randn(20)
|
93 |
+
sparse_tensor = torch.sparse_coo_tensor(indices, values, (10, 10))
|
94 |
+
print("β Sparse tensor creation")
|
95 |
+
|
96 |
+
# Test if torch-sparse is available (optional)
|
97 |
+
try:
|
98 |
+
import torch_sparse
|
99 |
+
print("β torch-sparse operations available")
|
100 |
+
except ImportError:
|
101 |
+
print("β Using built-in PyTorch sparse operations")
|
102 |
+
|
103 |
+
# Test if torch-scatter is available (optional)
|
104 |
+
try:
|
105 |
+
import torch_scatter
|
106 |
+
print("β torch-scatter operations available")
|
107 |
+
except ImportError:
|
108 |
+
print("β torch-scatter not available (not critical)")
|
109 |
+
|
110 |
+
except Exception as e:
|
111 |
+
print(f"β Basic functionality test failed: {e}")
|
112 |
+
traceback.print_exc()
|
113 |
+
return False
|
114 |
|
115 |
return True
|
116 |
|