diff --git a/autograd/numpy/numpy_wrapper.py b/autograd/numpy/numpy_wrapper.py index c6c3232e..750b3e23 100644 --- a/autograd/numpy/numpy_wrapper.py +++ b/autograd/numpy/numpy_wrapper.py @@ -18,11 +18,10 @@ class IntdtypeSubclass(cls): def wrap_namespace(old, new): unchanged_types = {float, int, type(None), type} int_types = {_np.int, _np.int8, _np.int16, _np.int32, _np.int64, _np.integer} - function_types = {_np.ufunc, types.FunctionType, types.BuiltinFunctionType} for name, obj in old.items(): if obj in notrace_functions: new[name] = notrace_primitive(obj) - elif type(obj) in function_types: + elif callable(obj) and type(obj) is not type: new[name] = primitive(obj) elif type(obj) is type and obj in int_types: new[name] = wrap_intdtype(obj)