This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 926f2e2  add deprecated profiler_set_state() (#10156)
926f2e2 is described below

commit 926f2e231334c5a2832b3b79b31cb4e47dde2b1c
Author: Chris Olivier <[email protected]>
AuthorDate: Mon Mar 19 15:11:28 2018 -0700

    add deprecated profiler_set_state() (#10156)
---
 python/mxnet/profiler.py | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/python/mxnet/profiler.py b/python/mxnet/profiler.py
index 3ef262e..0e7a31c 100644
--- a/python/mxnet/profiler.py
+++ b/python/mxnet/profiler.py
@@ -58,7 +58,7 @@ def set_config(**kwargs):
 
 
 def profiler_set_config(mode='symbolic', filename='profile.json'):
-    """Set up the configure of profiler.
+    """Set up the configure of profiler (Deprecated).
 
     Parameters
     ----------
@@ -68,7 +68,7 @@ def profiler_set_config(mode='symbolic', 
filename='profile.json'):
     filename : string, optional
         The name of output trace file. Defaults to 'profile.json'.
     """
-    warnings.warn('profiler.profiler_set_config() is deprecated. ' \
+    warnings.warn('profiler.profiler_set_config() is deprecated. '
                   'Please use profiler.set_config() instead')
     keys = c_str_array([key for key in ["profile_" + mode, "filename"]])
     values = c_str_array([str(val) for val in [True, filename]])
@@ -89,6 +89,19 @@ def set_state(state='stop'):
     check_call(_LIB.MXSetProfilerState(ctypes.c_int(state2int[state])))
 
 
+def profiler_set_state(state='stop'):
+    """Set up the profiler state to 'run' or 'stop' (Deprecated).
+
+    Parameters
+    ----------
+    state : string, optional
+        Indicates whether to run the profiler, can
+        be 'stop' or 'run'. Default is `stop`.
+    """
+    warnings.warn('profiler.profiler_set_state() is deprecated. '
+                  'Please use profiler.set_state() instead')
+    set_state(state)
+
 def dump(finished=True):
     """Dump profile and stop profiler. Use this to save profile
     in advance in case your program cannot exit normally.
@@ -106,7 +119,7 @@ def dump(finished=True):
 def dump_profile():
     """Dump profile and stop profiler. Use this to save profile
     in advance in case your program cannot exit normally."""
-    warnings.warn('profiler.dump_profile() is deprecated. ' \
+    warnings.warn('profiler.dump_profile() is deprecated. '
                   'Please use profiler.dump() instead')
     dump(True)
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to