def ortmodel_kwargs()

in optimum_benchmark/backends/onnxruntime/backend.py [0:0]


    def ortmodel_kwargs(self) -> Dict[str, Any]:
        kwargs = {}

        if self.config.export is not None:
            kwargs["export"] = self.config.export

        if self.config.provider is not None:
            kwargs["provider"] = self.config.provider

        if self.config.use_cache is not None:
            kwargs["use_cache"] = self.config.use_cache

        if self.config.use_merged is not None:
            kwargs["use_merged"] = self.config.use_merged

        if self.config.torch_dtype is not None:
            kwargs["torch_dtype"] = self.config.torch_dtype

        if self.config.use_io_binding is not None:
            kwargs["use_io_binding"] = self.config.use_io_binding

        if self.config.session_options:
            kwargs["session_options"] = SessionOptions()
            for key, value in self.config.session_options.items():
                setattr(kwargs["session_options"], key, value)

        if self.config.provider_options:
            kwargs["provider_options"] = self.config.provider_options

        return kwargs