From 5c1e96473958d34016bc509068fdd4d5269d9f50 Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Wed, 6 Nov 2019 16:16:44 -0800 Subject: [PATCH] Add example for documentation --- python/mxnet/runtime.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/python/mxnet/runtime.py b/python/mxnet/runtime.py index f2e98fe674fa..727fec9a9ec8 100644 --- a/python/mxnet/runtime.py +++ b/python/mxnet/runtime.py @@ -19,7 +19,28 @@ # pylint: disable=not-an-iterable -"""runtime querying of compile time features in the native library""" +"""Runtime querying of compile time features in the native library. + +With this module you can check at runtime which libraries and features were compiled in the library. + +Example usage: + +.. code-block:: python + + import mxnet + features=mxnet.runtime.Features() + + features.is_enabled("CUDNN") + False + + features.is_enabled("CPU_SSE") + True + + print(features) + [✖ CUDA, ✖ CUDNN, ✖ NCCL, ✖ CUDA_RTC, ✖ TENSORRT, ✔ CPU_SSE, ✔ CPU_SSE2, ✔ CPU_SSE3, ✔ CPU_SSE4_1, ✔ CPU_SSE4_2, ✖ CPU_SSE4A, ✔ CPU_AVX, ✖ CPU_AVX2, ✔ OPENMP, ✖ SSE, ✔ F16C, ✔ JEMALLOC, ✔ BLAS_OPEN, ✖ BLAS_ATLAS, ✖ BLAS_MKL, ✖ BLAS_APPLE, ✔ LAPACK, ✖ MKLDNN, ✔ OPENCV, ✖ CAFFE, ✖ PROFILER, ✖ DIST_KVSTORE, ✖ CXX14, ✖ INT64_TENSOR_SIZE, ✔ SIGNAL_HANDLER, ✔ DEBUG, ✖ TVM_OP] + + +""" import ctypes import collections