diff --git a/aten/src/ATen/core/PythonFallbackKernel.cpp b/aten/src/ATen/core/PythonFallbackKernel.cpp index ace0b5e8949..fcdb018b6ff 100644 --- a/aten/src/ATen/core/PythonFallbackKernel.cpp +++ b/aten/src/ATen/core/PythonFallbackKernel.cpp @@ -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()) {