We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2da6cac commit d13fa5fCopy full SHA for d13fa5f
paddle/fluid/pybind/sot/guards.cc
@@ -84,6 +84,10 @@ bool TypeMatchGuard::check(PyObject* value) {
84
bool IdMatchGuard::check(PyObject* value) { return value == expected_; }
85
86
bool ValueMatchGuard::check(PyObject* value) {
87
+ if (value == NULL) {
88
+ PyErr_Clear();
89
+ return false;
90
+ }
91
return PyObject_Equal(value, expected_value_);
92
}
93
@@ -107,6 +111,10 @@ bool DtypeMatchGuard::check(PyObject* value) {
107
111
108
112
109
113
bool ShapeMatchGuard::check(PyObject* value) {
114
115
116
117
110
118
auto tensor = GetTensorFromPyObject(value);
119
if (!tensor) {
120
return false;
0 commit comments