"mmdet/visualization/palette.py" did not exist on "6515fb96bc12fdced88f9163a8b7360abd917655"
onnx.hpp 1.23 KB
Newer Older
Paul's avatar
Paul committed
1
2
#ifndef MIGRAPHX_GUARD_MIGRAPHLIB_ONNX_HPP
#define MIGRAPHX_GUARD_MIGRAPHLIB_ONNX_HPP
Paul's avatar
Paul committed
3

Paul's avatar
Paul committed
4
5
#include <migraphx/program.hpp>
#include <migraphx/config.hpp>
Paul's avatar
Paul committed
6

Paul's avatar
Paul committed
7
namespace migraphx {
Paul's avatar
Paul committed
8
inline namespace MIGRAPHX_INLINE_NS {
Paul's avatar
Paul committed
9

10
11
12
/// struct to pass in onnx options to parser
struct onnx_options
{
13
    /// default batch size to use (if not specified in onnx file)
14
    int default_dim_value = 1;
15
    /// Explicitly specify the dims of an input
16
    std::unordered_map<std::string, std::vector<int>> map_input_dims = {};
17
18
19
20
    /// Continue parsing onnx file if an unknown operator is found
    bool skip_unknown_operators = false;
    /// Print program if an error occurs
    bool print_program_on_error = false;
Shucai Xiao's avatar
Shucai Xiao committed
21
22
    /// Max iter num for the loop operator
    int64_t max_loop_iterations = 10;
23
24
};

Paul's avatar
Paul committed
25
/// Create a program from an onnx file
26
program parse_onnx(const std::string& name, const onnx_options& = onnx_options{});
Paul's avatar
Paul committed
27

Paul Fultz II's avatar
Paul Fultz II committed
28
/// Create a program from an onnx buffer
29
program parse_onnx_buffer(const std::string& buffer, const onnx_options& options);
Paul Fultz II's avatar
Paul Fultz II committed
30
31

/// Create a program from an onnx buffer
32
program parse_onnx_buffer(const void* data, int size, const onnx_options& options);
Paul Fultz II's avatar
Paul Fultz II committed
33

34
35
std::vector<std::string> get_onnx_operators();

Paul's avatar
Paul committed
36
} // namespace MIGRAPHX_INLINE_NS
Paul's avatar
Paul committed
37
} // namespace migraphx
Paul's avatar
Paul committed
38
39

#endif