onnxruntime/onnxruntime
Yifan Li efe0af3720
[TensorRT EP] Fix nullptr check (#16468)
### Description
Fix the nullptr check so that it would check the actual existence of
engine/context
(Currently, it checks the address of unique_ptr, which is always not
null. Thx @jslhcl for pointing that out)

> A quick recall of struct
[trt_state](https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.h#L104):
> ```
> std::unique_ptr<nvinfer1::ICudaEngine>* engine = nullptr;
>std::unique_ptr<nvinfer1::IExecutionContext>* context = nullptr;
>```


### Motivation and Context
https://github.com/microsoft/onnxruntime/issues/15982
The incorrect check couldn't stop TRT EP from loading incompatible
engine cache on purpose, which invokes unhandled exception
2023-06-26 09:02:59 -07:00
..
contrib_ops Add license header to CUDA related files (#16437) 2023-06-21 13:31:43 -07:00
core [TensorRT EP] Fix nullptr check (#16468) 2023-06-26 09:02:59 -07:00
python GPT-2 attention fusion for transformers >= 4.27 (#16461) 2023-06-23 15:38:35 -07:00
test Eliminate safe nodes that are followed by a shape node. (#16065) 2023-06-26 16:35:07 +08:00
tool/etw
wasm [js/web] enable ONNX Runtime Web error messages in JS (#16335) 2023-06-15 09:45:41 -07:00
__init__.py ExecutionProvider API refactor - move allocator from EP level to SessionState level and indexed by OrtDevice (#15833) 2023-06-19 17:44:45 -07:00
ReformatSource.ps1
ReformatSourcePython.bat
VSCodeCoverage.runsettings