-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_installation.py
More file actions
48 lines (38 loc) · 1.49 KB
/
check_installation.py
File metadata and controls
48 lines (38 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
#!/usr/bin/env python3
"""
KortexDL Installation Verification Script
Run this script to verify that KortexDL is correctly installed and functioning.
"""
import sys
import numpy as np
def verify_installation():
print("Checking KortexDL installation...")
try:
import kortexdl as bd
print(f"✅ Successfully imported kortexdl v{bd.__version__}")
print(f" Location: {bd.__file__}")
except ImportError as e:
print("❌ Failed to import kortexdl")
print(f"Error: {e}")
print("\nTroubleshooting:")
print("1. Ensure you have activated your environment (source ~/intel/oneapi/setvars.sh)")
print("2. Try reinstalling: pip install -e .")
sys.exit(1)
print("\nRunning functional check...")
try:
# Create a tiny network
net = bd.Network([2, 5, 1], bd.ActivationType.ReLU)
print("✅ Network creation successful")
# Forward pass
input_data = np.array([0.5, -0.5], dtype=np.float32)
output = net.forward(input_data)
print(f"✅ Forward pass successful. Output: {output}")
# Optimizer check
opt = bd.create_optimizer(bd.OptimizerType.Adam, 0.01)
print("✅ Optimizer creation successful")
print("\n🎉 KortexDL is correctly installed and functional!")
except Exception as e:
print(f"\n❌ Functional check failed: {e}")
sys.exit(1)
if __name__ == "__main__":
verify_installation()