more modifications
This commit is contained in:
parent
30e5e29d48
commit
a7c3bc9ebd
|
@ -213,6 +213,8 @@ class Interpreter(object):
|
|||
if num_threads:
|
||||
if not isinstance(num_threads, int):
|
||||
raise ValueError('type of num_threads should be int')
|
||||
if num_threads < 1:
|
||||
raise ValueError('num_threads should >= 1')
|
||||
self._interpreter.SetNumThreads(num_threads)
|
||||
|
||||
# Each delegate is a wrapper that owns the delegates that have been loaded
|
||||
|
|
|
@ -148,8 +148,8 @@ PYBIND11_MODULE(_pywrap_tensorflow_interpreter_wrapper, m) {
|
|||
)pbdoc")
|
||||
.def(
|
||||
"SetNumThreads",
|
||||
[](InterpreterWrapper& self, int i) {
|
||||
return tensorflow::PyoOrThrow(self.SetNumThreads(i));
|
||||
[](InterpreterWrapper& self, int num_threads) {
|
||||
return tensorflow::PyoOrThrow(self.SetNumThreads(num_threads));
|
||||
},
|
||||
R"pbdoc(
|
||||
ask the interpreter to set the number of threads to use.
|
||||
|
|
Loading…
Reference in New Issue