Commits


Yongxin Wang authored and GitHub committed cfe93a1eab4
fix type annotation for sess_options (#19393) ### Description Changed the type annotation of sess_options in InferenceSession's `__init__` method ### Motivation and Context sess_options is one `SessionOptions`, not a sequence of it. It is passed directly into `C.InferenceSession`, and from the definition of [`C.InferenceSession`](https://github.com/microsoft/onnxruntime/blob/efc17e79de8c1a62eb419d19576ccb90b371b0d0/onnxruntime/python/onnxruntime_pybind_state.cc#L1790), we can see that it is not a sequence: ```cpp py::class_<PyInferenceSession>(m, "InferenceSession", R"pbdoc(This is the main class used to run a model.)pbdoc") // In Python3, a Python bytes object will be passed to C++ functions that accept std::string or char* // without any conversion. So this init method can be used for model file path (string) and model content (bytes) .def(py::init([](const PySessionOptions& so, const std::string arg, bool is_arg_file_name, bool load_config_from_model = false) { ```