Scikit-learn
human-activity-recognition
wearable
wrist
time-series
cpu
scikit-learn
File size: 531 Bytes
ac7f7cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Look up optional CPU symbols from the installed extension or standalone C build."""
import ctypes
from importlib.util import find_spec
from pathlib import Path


def lookup(symbol):
    ext = find_spec("wisp_fast._kernels")
    paths = [ext.origin] if ext is not None and ext.origin else []
    paths.append(Path(__file__).with_name("_wisp_viterbi.so"))
    for path in paths:
        try:
            return getattr(ctypes.CDLL(str(path)), symbol)
        except (OSError, AttributeError):
            continue
    return None