diff --git a/torch/csrc/distributed/rpc/script_call.cpp b/torch/csrc/distributed/rpc/script_call.cpp index 3989e550f8fcf..3c1df53e9ce19 100644 --- a/torch/csrc/distributed/rpc/script_call.cpp +++ b/torch/csrc/distributed/rpc/script_call.cpp @@ -83,6 +83,10 @@ void ScriptCall::toIValues(std::vector& ivalues) const { std::unique_ptr ScriptCall::fromIValues( std::vector& ivalues) { + TORCH_INTERNAL_ASSERT( + ivalues.size() > 1, + "At least 2 IValues are required to build a ScriptCall."); + // Last element in the vector is always qualifiedName for both // builitin operator and TorchScript function // If the qualifiedName is not a builtin operator name, then treat it