Skip to content

Commit c65bc42

Browse files
pytorchmergebotmansiag05
authored andcommitted
Revert "[dynamo][guards] Fail on an unknown framelocals to dict conversion (pytorch#162695)"
This reverts commit a8432bc. Reverted pytorch#162695 on behalf of https://github.com/anijain2305 due to internal failure at https://fburl.com/workplace/qiitdlp6 ([comment](pytorch#162695 (comment)))
1 parent d21aa7e commit c65bc42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torch/csrc/dynamo/guards.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,9 @@ class GuardAccessor {
26952695
// subtree on immutable dict getitems.
26962696
virtual bool check_nopybind(PyObject* obj, bool matches_dict_tag = false) = 0;
26972697
virtual bool check_nopybind(FrameLocalsMapping* map, bool matches_dict_tag) {
2698-
throw std::runtime_error("fallback to python");
2698+
// throw std::runtime_error("fallback to python");
2699+
// Could fallback to running check on the Python dict (lazily constructed)
2700+
return check_nopybind((PyObject*)map->to_dict(), matches_dict_tag);
26992701
}
27002702
virtual GuardDebugInfo check_verbose_nopybind(PyObject* obj) = 0;
27012703
virtual std::string repr() const = 0;

0 commit comments

Comments
 (0)