mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[Exception] [4/N] Replace torch::IndexError and torch::ValueError with C10 counterparts (#117317)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/117317 Approved by: https://github.com/ezyang
This commit is contained in:
@ -355,12 +355,13 @@ inline PythonArgs PythonArgParser::parse(
|
||||
PyObject* args,
|
||||
PyObject* kwargs,
|
||||
ParsedArgs<N>& dst) {
|
||||
if (N < max_args) {
|
||||
throw ValueError(
|
||||
"PythonArgParser: dst ParsedArgs buffer does not have enough capacity, expected %d (got %d)",
|
||||
(int)max_args,
|
||||
N);
|
||||
}
|
||||
TORCH_CHECK_VALUE(
|
||||
N >= max_args,
|
||||
"PythonArgParser: dst ParsedArgs buffer does not have enough capacity, expected ",
|
||||
max_args,
|
||||
" (got ",
|
||||
N,
|
||||
")");
|
||||
return raw_parse(self, args, kwargs, dst.args);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user