Files
StarPilot/selfdrive/modeld/runners/thneedmodel_pyx.pyx
T
Dean Lee 29dda3b232 Fix FutureWarning "Cython directive 'language_level' not set" (#33046)
fix FutureWarning
old-commit-hash: fb3336614484553456bee6c2116b729177ecbc46
2024-07-23 09:27:10 -07:00

15 lines
643 B
Cython

# distutils: language = c++
# cython: c_string_encoding=ascii, language_level=3
from libcpp cimport bool
from libcpp.string cimport string
from .thneedmodel cimport ThneedModel as cppThneedModel
from selfdrive.modeld.models.commonmodel_pyx cimport CLContext
from selfdrive.modeld.runners.runmodel_pyx cimport RunModel
from selfdrive.modeld.runners.runmodel cimport RunModel as cppRunModel
cdef class ThneedModel(RunModel):
def __cinit__(self, string path, float[:] output, int runtime, bool use_tf8, CLContext context):
self.model = <cppRunModel *> new cppThneedModel(path, &output[0], len(output), runtime, use_tf8, context.context)