Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/mxnet/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""Monitor outputs, weights, and gradients for debugging."""
import ctypes
from .ndarray import NDArray
from .base import NDArrayHandle
from .base import NDArrayHandle, py_str
from . import ndarray
import logging
from math import sqrt
Expand Down Expand Up @@ -43,11 +43,11 @@ def asum_stat(x):
self.sort = sort
def stat_helper(name, array):
"""wrapper for executor callback"""
if not self.activated or not self.re_prog.match(name):
if not self.activated or not self.re_prog.match(py_str(name)):
return
array = ctypes.cast(array, NDArrayHandle)
array = NDArray(array, writable=False)
self.queue.append((self.step, name, self.stat_func(array)))
self.queue.append((self.step, py_str(name), self.stat_func(array)))
self.stat_helper = stat_helper

def install(self, exe):
Expand Down