Skip to content

Commit efef1a8

Browse files
committed
Add back overloads to avoid calling the void* one
1 parent 3c8e0d7 commit efef1a8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

torch/csrc/autograd/utils/wrap_outputs.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,18 @@ inline PyObject* wrap(void* value) {
5252
return THPUtils_packInt64(reinterpret_cast<intptr_t>(value));
5353
}
5454

55+
inline PyObject* wrap(THPDtype* dtype) {
56+
return Py_NewRef(dtype);
57+
}
58+
5559
inline PyObject* wrap(at::ScalarType scalarType) {
5660
return Py_NewRef(getTHPDtype(scalarType));
5761
}
5862

63+
inline PyObject* wrap(THPLayout* layout) {
64+
return Py_NewRef(layout);
65+
}
66+
5967
inline PyObject* wrap(at::Layout layout) {
6068
return Py_NewRef(getTHPLayout(layout));
6169
}

0 commit comments

Comments
 (0)