ó —Àv]c@ssdZddlZddlZddlmZmZdejfd„ƒYZd„Zdej fd „ƒYZ dS( s?runtime querying of compile time features in the native libraryiÿÿÿÿNi(t_LIBt check_calltFeaturecBsSeZdZdejfdejfgZed„ƒZed„ƒZ d„Z RS(sP Compile time feature description, member fields: `name` and `enabled`. t_namet_enabledcCs |jjƒS(s Feature name. (Rtdecode(tself((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pytname%scCs|jS(sQ True if MXNet was compiled with the given compile-time feature. (R(R((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pytenabled,scCs-|jrdj|jƒSdj|jƒSdS(Ns✔ {}s✖ {}(RtformatR(R((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyt__repr__3s ( t__name__t __module__t__doc__tctypestc_char_ptc_boolt_fields_tpropertyRRR (((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyRs  cCsptjtƒƒ}tjƒ}ttjtj|ƒtj|ƒƒƒgt|j ƒD]}||^qV}|S(s Check the library for compile-time features. The list of features are maintained in libinfo.h and libinfo.cc Returns ------- list List of :class:`.Feature` objects ( RtPOINTERRtc_size_tRRtMXLibInfoFeaturestbyreftrangetvalue(tlib_features_c_arraytlib_features_sizetitfeatures((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyt feature_list9s  (&tFeaturescBs)eZdZd„Zd„Zd„ZRS(s( OrderedDict of name to Feature cCs9tt|ƒjgtƒD]}|j|f^qƒdS(N(tsuperRt__init__RR(Rtf((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyR LscCstt|jƒƒƒS(N(tstrtlisttvalues(R((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyR OscCsJ|jƒ}||kr?tdj|t|jƒƒƒƒ‚n||jS(sR Check for a particular feature by name Parameters ---------- feature_name: str The name of a valid feature as string for example 'CUDA' Returns ------- Boolean True if it's enabled, False if it's disabled, RuntimeError if the feature is not known s/Feature '{}' is unknown, known features are: {}(tuppert RuntimeErrorR R#tkeysR(Rt feature_name((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyt is_enabledRs    (R R R R R R)(((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyRHs  ( R Rt collectionstbaseRRt StructureRRt OrderedDictR(((s./tmp/pip-install-Qvdv_2/mxnet/mxnet/runtime.pyts