mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Fix some bugs in SymFloat IValue and toPyObject handling (#86072)
- Test for symbolic cases first before non-symbolic, as symbolic ints/floats advertise as being ints/floats - Add missing case for toPyObject Signed-off-by: Edward Z. Yang <ezyang@fb.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/86072 Approved by: https://github.com/wconstab
This commit is contained in:
committed by
PyTorch MergeBot
parent
a66506b136
commit
8753703b68
@ -627,8 +627,9 @@ py::object toPyObject(IValue ivalue) {
|
||||
TORCH_CHECK(false, "RRef is only supported with the distributed package");
|
||||
#endif
|
||||
} else if (ivalue.isSymInt()) {
|
||||
auto si = ivalue.toSymInt();
|
||||
return py::cast(si);
|
||||
return py::cast(ivalue.toSymInt());
|
||||
} else if (ivalue.isSymFloat()) {
|
||||
return py::cast(ivalue.toSymFloat());
|
||||
} else {
|
||||
AT_ERROR(
|
||||
"Missing cases in 'toPyObject'! Can't convert ",
|
||||
|
Reference in New Issue
Block a user