mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-23 19:32:23 +00:00
Fix a path problem in onnxruntime_perf_test (#21341)
### Description Resolve #21267 . onnxruntime_perf_test does not work properly if the input model path url is just a single filename without any path separator. For example, ``` ./onnxruntime_perf_test -t 10 model.onnx ``` The problem was introduced in #19196 by me.
This commit is contained in:
parent
281ed8c12d
commit
dfaf18928a
1 changed files with 2 additions and 1 deletions
|
|
@ -53,7 +53,8 @@ class TestModelInfo {
|
|||
public:
|
||||
virtual const std::filesystem::path& GetModelUrl() const = 0;
|
||||
virtual std::filesystem::path GetDir() const {
|
||||
return GetModelUrl().parent_path();
|
||||
const auto& p = GetModelUrl();
|
||||
return p.has_parent_path() ? p.parent_path() : std::filesystem::current_path();
|
||||
}
|
||||
virtual const std::string& GetNodeName() const = 0;
|
||||
virtual const ONNX_NAMESPACE::ValueInfoProto* GetInputInfoFromModel(size_t i) const = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue