[NNPACK] Add check for NNPACK being available (nnp_initialize() succeeding) (#2119)
This fixes issues with failing tests on PowerPC.
This commit is contained in:
committed by
Tianqi Chen
parent
572c36d2fe
commit
69ad6aed82
@@ -5,16 +5,11 @@ from .. import api as _api
|
||||
from .. import intrin as _intrin
|
||||
from .._ffi.function import _init_api
|
||||
|
||||
def config(nthreads):
|
||||
"""Configure the nnpack library.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
nthreads : int
|
||||
The threads number of nnpack thread pool, must be a nonnegative.
|
||||
|
||||
def is_available():
|
||||
"""Check whether NNPACK is available, that is, `nnp_initialize()`
|
||||
returns `nnp_status_success`.
|
||||
"""
|
||||
_Config(nthreads)
|
||||
return _initialize() == 0
|
||||
|
||||
def fully_connected_inference(lhs, rhs, nthreads=1):
|
||||
"""Create an extern op that compute fully connected of 1D tensor lhs and
|
||||
|
||||
Reference in New Issue
Block a user