8000 BUG: reference cycle in np.vectorize by mattip · Pull Request #11977 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: reference cycle in np.vectorize #11977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
MAINT: cleanup comments and harmless reference assignment
  • Loading branch information
mattip committed Dec 18, 2018
commit f73d96d7aef824f6e6da193f9d9e1a525f3639d1
8 changes: 6 additions & 2 deletions numpy/core/include/numpy/ufuncobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ typedef struct _tagPyUFuncObject {
*/
int nin, nout, nargs;

/* Identity for reduction, either PyUFunc_One or PyUFunc_Zero */
/*
* Identity for reduction, any of PyUFunc_One, PyUFunc_Zero
* PyUFunc_MinusOne, PyUFunc_None, PyUFunc_ReorderableNone,
* PyUFunc_IdentityValue.
*/
int identity;

/* Array of one-dimensional core loops */
Expand Down Expand Up @@ -301,7 +305,7 @@ typedef struct _tagPyUFuncObject {
*/
#define PyUFunc_ReorderableNone -2
/*
* UFunc unit is in identity_value, and the order of operations can be reordered
* UFunc unit is an identity_value, and the order of operations can be reordered
* This case allows reduction with multiple axes at once.
*/
#define PyUFunc_IdentityValue -3
Expand Down
4 changes: 3 additions & 1 deletion numpy/core/src/umath/ufunc_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -4908,8 +4908,10 @@ PyUFunc_FromFuncAndDataAndSignatureAndIdentity(PyUFuncGenericFunction *func, voi
ufunc->identity = identity;
if (ufunc->identity == PyUFunc_IdentityValue) {
Py_INCREF(identity_value);
ufunc->identity_value = identity_value;
} else {
ufunc->identity_value = NULL;
}
ufunc->identity_value = identity_value;

ufunc->functions = func;
ufunc->data = data;
Expand Down
0