3
Eg @ sX d dl Z d dlZd dlmZ d dlmZmZ dddZe Z e Z
dd Zdd d
ZdS )
N)Lock)coreextension_loaderTc C s. t jj| stdj| dS t| |d dS )aO Loads a dynamic library that contains custom operators into Caffe2.
Since Caffe2 uses static variable registration, you can optionally load a
separate .so file that contains custom operators and registers that into
the caffe2 core binary. In C++, this is usually done by either declaring
dependency during compilation time, or via dynload. This allows us to do
registration similarly on the Python side.
Args:
name: a name that ends in .so, such as "my_custom_op.so". Otherwise,
the command will simply be ignored.
Returns:
None
z&Ignoring {} as it is not a valid file.N)trigger_lazy)ospathexistsprintformat
_init_impl)namer r
@/usr/local/lib64/python3.6/site-packages/caffe2/python/dyndep.pyInitOpsLibrary s r c C s t S )N)_IMPORTED_DYNDEPSr
r
r
r GetImportedOpsLibraries* s r c C sF t 8 tj| tj tj| W d Q R X tj| W d Q R X d S )N) dll_lockr addr ZDlopenGuardctypesCDLLr ZRefreshRegisteredOperators)r r r
r
r r . s
r )T)T)
r r threadingr Z
caffe2.pythonr r r setr r r r r
r
r
r