mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Fix bug in PythonFallBack (#85795)
Summary: Previously PythonCallBack fails to find interpreter to dispatch to when it encounters an op with OptionalTensorList parameter, this diff fixes that Test Plan: CI Differential Revision: D39881382 Pull Request resolved: https://github.com/pytorch/pytorch/pull/85795 Approved by: https://github.com/ezyang, https://github.com/bdhirsh
This commit is contained in:
parent
fe87ae692f
commit
a9183c0f9e
|
|
@ -73,7 +73,7 @@ void pythonFallback(const c10::OperatorHandle& op, torch::jit::Stack* stack) {
|
|||
(*interpreter)->dispatch(op, stack);
|
||||
return;
|
||||
}
|
||||
} else if (ivalue.isTensorList()) {
|
||||
} else if (ivalue.isTensorList() || (ivalue.isOptionalTensorList() && !ivalue.isNone())) {
|
||||
// NB: use toListRef as it doesn't induce refcount bumps (toTensorListRef
|
||||
// is not a thing)
|
||||
for (const auto& nv : ivalue.toListRef()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user