[Exception] [5/N] Remove torch::IndexError (#117713)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/117713
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2024-01-19 03:36:15 +00:00
committed by PyTorch MergeBot
parent 3131e0460e
commit 5c17f66a3d
2 changed files with 0 additions and 16 deletions

View File

@ -224,13 +224,6 @@ void translate_exception_to_python(const std::exception_ptr& e_ptr) {
CATCH_ALL_ERRORS(return)
}
IndexError::IndexError(const char* format, ...) {
va_list fmt_args{};
va_start(fmt_args, format);
msg = formatMessage(format, fmt_args);
va_end(fmt_args);
}
TypeError::TypeError(const char* format, ...) {
va_list fmt_args{};
va_start(fmt_args, format);

View File

@ -279,15 +279,6 @@ struct PyTorchError : public std::exception {
#define TORCH_FORMAT_FUNC(FORMAT_INDEX, VA_ARGS_INDEX)
#endif
// Translates to Python IndexError
struct IndexError : public PyTorchError {
using PyTorchError::PyTorchError;
IndexError(const char* format, ...) TORCH_FORMAT_FUNC(2, 3);
PyObject* python_type() override {
return PyExc_IndexError;
}
};
// Translates to Python TypeError
struct TypeError : public PyTorchError {
using PyTorchError::PyTorchError;