You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/01/15 22:36:57 UTC
[incubator-mxnet] Diff for: [GitHub] sandeep-krishnamurthy closed pull request #12408: [MXNET-875] pass global step and names of params to callback function stat_func i…
diff --git a/python/mxnet/monitor.py b/python/mxnet/monitor.py
index e3185a1281a..732728ec2d4 100644
--- a/python/mxnet/monitor.py
+++ b/python/mxnet/monitor.py
@@ -67,7 +67,7 @@ def stat_helper(name, array):
array = NDArray(array, writable=False)
if not self.activated or not self.re_prog.match(py_str(name)):
return
- self.queue.append((self.step, py_str(name), self.stat_func(array)))
+ self.queue.append((self.step, py_str(name), self.stat_func(py_str(name), self.step, array)))
self.stat_helper = stat_helper
def install(self, exe):
@@ -113,10 +113,10 @@ def toc(self):
for exe in self.exes:
for name, array in zip(exe._symbol.list_arguments(), exe.arg_arrays):
if self.re_prog.match(name):
- self.queue.append((self.step, name, self.stat_func(array)))
+ self.queue.append((self.step, name, self.stat_func(name, self.step, array)))
for name, array in zip(exe._symbol.list_auxiliary_states(), exe.aux_arrays):
if self.re_prog.match(name):
- self.queue.append((self.step, name, self.stat_func(array)))
+ self.queue.append((self.step, name, self.stat_func(name, self.step, array)))
self.activated = False
res = []
if self.sort:
With regards,
Apache Git Services