Skip to content

Commit 687577f

Browse files
committed
Rebase torch patches on autopatch changes
1 parent 0bed09e commit 687577f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

graalpython/lib-graalpython/patches/torch/torch-1.13.1.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ index b847129d..3219d1e1 100644
298298
def clone(self):
299299
return self.__class__(self.mode)
300300
diff --git a/torch/csrc/Module.cpp b/torch/csrc/Module.cpp
301-
index 3af2e723..df857f31 100644
301+
index 81e98428..df857f31 100644
302302
--- a/torch/csrc/Module.cpp
303303
+++ b/torch/csrc/Module.cpp
304304
@@ -257,50 +257,16 @@ PyObject* THPModule_addDocStr(PyObject* _unused, PyObject* args) {
@@ -307,13 +307,13 @@ index 3af2e723..df857f31 100644
307307

308308
- if (Py_TYPE(obj) == &PyCFunction_Type) {
309309
- PyCFunctionObject* f = (PyCFunctionObject*)obj;
310-
- if (PyObject_GetDoc((PyObject*)(f))) {
310+
- if (GraalPyCFunction_GetDoc((PyObject*)(f))) {
311311
- return PyErr_Format(
312312
- PyExc_RuntimeError,
313313
- "function '%s' already has a docstring",
314314
- _PyCFunction_GetMethodDef((PyObject*)(f))->ml_name);
315315
- }
316-
- PyObject_SetDoc((PyObject*)(f), doc_str);
316+
- GraalPyCFunction_SetDoc((PyObject*)(f), doc_str);
317317
- } else if (strcmp(Py_TYPE(obj)->tp_name, "method_descriptor") == 0) {
318318
- PyMethodDescrObject* m = (PyMethodDescrObject*)obj;
319319
- if (m->d_method->ml_doc) {

graalpython/lib-graalpython/patches/torch/torch-2.2.1.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ index 570a5581..feb1f95c 100644
274274
}
275275

276276
diff --git a/third_party/pybind11/include/pybind11/pybind11.h b/third_party/pybind11/include/pybind11/pybind11.h
277-
index d46de579..2f015c6e 100644
277+
index 818115cc..b4b3bf93 100644
278278
--- a/third_party/pybind11/include/pybind11/pybind11.h
279279
+++ b/third_party/pybind11/include/pybind11/pybind11.h
280280
@@ -551,7 +551,7 @@ protected:
@@ -347,7 +347,7 @@ index 1293a0fd..dfb4385a 100644
347347
+ torch._C._DisableFuncTorch():
348348
return _str_intern(self, tensor_contents=tensor_contents)
349349
diff --git a/torch/csrc/Module.cpp b/torch/csrc/Module.cpp
350-
index b85e94d2..0168b101 100644
350+
index bbf99ce4..0168b101 100644
351351
--- a/torch/csrc/Module.cpp
352352
+++ b/torch/csrc/Module.cpp
353353
@@ -341,46 +341,16 @@ PyObject* THPModule_addDocStr(PyObject* _unused, PyObject* args) {
@@ -356,13 +356,13 @@ index b85e94d2..0168b101 100644
356356

357357
- if (Py_TYPE(obj) == &PyCFunction_Type) {
358358
- PyCFunctionObject* f = (PyCFunctionObject*)obj;
359-
- if (PyObject_GetDoc((PyObject*)(f))) {
359+
- if (GraalPyCFunction_GetDoc((PyObject*)(f))) {
360360
- return PyErr_Format(
361361
- PyExc_RuntimeError,
362362
- "function '%s' already has a docstring",
363363
- _PyCFunction_GetMethodDef((PyObject*)(f))->ml_name);
364364
- }
365-
- PyObject_SetDoc((PyObject*)(f), doc_str);
365+
- GraalPyCFunction_SetDoc((PyObject*)(f), doc_str);
366366
- } else if (strcmp(Py_TYPE(obj)->tp_name, "method_descriptor") == 0) {
367367
- PyMethodDescrObject* m = (PyMethodDescrObject*)obj;
368368
- if (m->d_method->ml_doc) {

0 commit comments

Comments
 (0)