Skip to content

Commit a2b7985

Browse files
ricardoV94michaelosthege
authored andcommitted
Use PyObject_CallNoArgs to call thunks from VM
1 parent 70b0ce7 commit a2b7985

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pytensor/link/c/c_code/lazylinker_c.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static PyObject *pycall(CLazyLinker *self, Py_ssize_t node_idx, int verbose) {
477477
double t0 = pytime(NULL);
478478
if (verbose)
479479
fprintf(stderr, "calling via Python (node %i)\n", (int)node_idx);
480-
rval = PyObject_CallObject(thunk, NULL);
480+
rval = PyObject_CallNoArgs(thunk);
481481
if (rval) {
482482
double t1 = pytime(NULL);
483483
double ti = PyFloat_AsDouble(PyList_GetItem(self->call_times, node_idx));
@@ -491,7 +491,7 @@ static PyObject *pycall(CLazyLinker *self, Py_ssize_t node_idx, int verbose) {
491491
if (verbose) {
492492
fprintf(stderr, "calling via Python (node %i)\n", (int)node_idx);
493493
}
494-
rval = PyObject_CallObject(thunk, NULL);
494+
rval = PyObject_CallNoArgs(thunk);
495495
}
496496
return rval;
497497
}
@@ -981,7 +981,7 @@ static PyTypeObject lazylinker_ext_CLazyLinkerType = {
981981
};
982982

983983
static PyObject *get_version(PyObject *dummy, PyObject *args) {
984-
PyObject *result = PyFloat_FromDouble(0.3);
984+
PyObject *result = PyFloat_FromDouble(0.31);
985985
return result;
986986
}
987987

pytensor/link/c/lazylinker_c.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
_logger = logging.getLogger(__file__)
1515

1616
force_compile = False
17-
version = 0.3 # must match constant returned in function get_version()
17+
version = 0.31 # must match constant returned in function get_version()
1818
lazylinker_ext: ModuleType | None = None
1919

2020

0 commit comments

Comments
 (0)