Skip to content

Commit 49ae74e

Browse files
Fix memory leak in TensorFromScalar
1 parent ec4821e commit 49ae74e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

aesara/tensor/basic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,16 +577,15 @@ def c_code(self, node, name, inputs, outputs, sub):
577577
return (
578578
"""
579579
%(z)s = (PyArrayObject*)PyArray_FromScalar(py_%(x)s, NULL);
580-
if(py_%(z)s == NULL){
580+
if(%(z)s == NULL){
581581
%(fail)s;
582582
}
583-
Py_XINCREF(%(z)s);
584583
"""
585584
% locals()
586585
)
587586

588587
def c_code_cache_version(self):
589-
return (1,)
588+
return (2,)
590589

591590

592591
tensor_from_scalar = TensorFromScalar()

0 commit comments

Comments
 (0)