提交 5ad11819 authored 作者: Thomas Wiecki's avatar Thomas Wiecki

Fix memory leak in TensorFromScalar

上级 c9159b2d
......@@ -593,16 +593,15 @@ class TensorFromScalar(COp):
return (
"""
%(z)s = (PyArrayObject*)PyArray_FromScalar(py_%(x)s, NULL);
if(py_%(z)s == NULL){
if(%(z)s == NULL){
%(fail)s;
}
Py_XINCREF(%(z)s);
"""
% locals()
)
def c_code_cache_version(self):
return (1,)
return (2,)
tensor_from_scalar = TensorFromScalar()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论