onnxruntime/onnxruntime/test/perftest/TFModelInfo.h
Scott McKay 16cef90e29
General enhancements/cleanups to test exes (#4109)
* General enhancements/cleanups to test exes
  - Support running onnxruntime_perf_test with no output file
    - if you're profiling the output file is often unused and can be very large
  - Allow failure to override early success if doing multiple runs of a test using running onnx_test_runner
    - e.g. if the second run fails that's more important as a final status
  - Clarify ownership semantics
  - Cleanup naming, line lengths, usage of references for required parameters etc.
2020-06-04 07:01:39 +10:00

31 lines
1,007 B
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "TestCase.h"
#include <string>
#include <vector>
class TFModelInfo : public TestModelInfo {
public:
const PATH_CHAR_TYPE* GetModelUrl() const override { return model_url_.c_str(); }
const std::string& GetNodeName() const override { return node_name_; }
const ONNX_NAMESPACE::ValueInfoProto* GetOutputInfoFromModel(size_t) const override { return nullptr; }
int GetInputCount() const override;
int GetOutputCount() const override;
const std::string& GetInputName(size_t i) const override;
const std::string& GetOutputName(size_t i) const override;
~TFModelInfo() override = default;
static std::unique_ptr<TestModelInfo> Create(_In_ const PATH_CHAR_TYPE* model_url);
private:
TFModelInfo() = default;
std::basic_string<PATH_CHAR_TYPE> model_url_;
std::vector<std::string> input_names_;
std::vector<std::string> output_names_;
std::string node_name_;
};