|
10 | 10 | #include <type_traits> |
11 | 11 | #include <unordered_map> |
12 | 12 | #include <unordered_set> |
13 | | - |
14 | | -#ifdef _WIN32 |
15 | | -#pragma warning(push) |
16 | | -// disable some warnings from protobuf to pass Windows build |
17 | | -#pragma warning(disable : 4244) |
18 | | -#endif |
19 | | - |
20 | | -#ifdef _WIN32 |
21 | | -#pragma warning(pop) |
22 | | -#endif |
| 13 | +#include <filesystem> |
23 | 14 |
|
24 | 15 | #include "core/common/flatbuffers.h" |
25 | 16 |
|
@@ -147,7 +138,7 @@ class Node { |
147 | 138 | const std::string& Domain() const noexcept { return domain_; } |
148 | 139 |
|
149 | 140 | /** Gets the path of the owning model if any. */ |
150 | | - const Path& ModelPath() const noexcept; |
| 141 | + const std::filesystem::path& ModelPath() const noexcept; |
151 | 142 |
|
152 | 143 | /** Gets the Node's execution priority. |
153 | 144 | @remarks Lower value means higher priority */ |
@@ -693,7 +684,7 @@ class Graph { // NOLINT(clang-analyzer-optin.performance.Padding): preserve exi |
693 | 684 | const std::string& Description() const noexcept; |
694 | 685 |
|
695 | 686 | /** Gets the path of the owning model, if any. */ |
696 | | - const Path& ModelPath() const; |
| 687 | + const std::filesystem::path& ModelPath() const; |
697 | 688 |
|
698 | 689 | /** Returns true if this is a subgraph or false if it is a high-level graph. */ |
699 | 690 | bool IsSubgraph() const { return parent_graph_ != nullptr; } |
@@ -1149,13 +1140,14 @@ class Graph { // NOLINT(clang-analyzer-optin.performance.Padding): preserve exi |
1149 | 1140 | ONNX_NAMESPACE::GraphProto ToGraphProto() const; |
1150 | 1141 |
|
1151 | 1142 | /** Gets the GraphProto representation of this Graph |
1152 | | - @params external_file_name name of the binary file to use for initializers |
| 1143 | + @param external_file_path File path of the binary file to use for initializers. |
| 1144 | + @param model_file_path path of the model file. |
1153 | 1145 | @param initializer_size_threshold initializers larger or equal to this threshold (in bytes) are saved |
1154 | 1146 | in the external file. Initializer smaller than this threshold are included in the onnx file. |
1155 | 1147 | @returns GraphProto serialization of the graph. |
1156 | 1148 | */ |
1157 | | - ONNX_NAMESPACE::GraphProto ToGraphProtoWithExternalInitializers(const std::string& external_file_name, |
1158 | | - const PathString& file_path, |
| 1149 | + ONNX_NAMESPACE::GraphProto ToGraphProtoWithExternalInitializers(const std::filesystem::path& external_file_path, |
| 1150 | + const std::filesystem::path& model_file_path, |
1159 | 1151 | size_t initializer_size_threshold) const; |
1160 | 1152 |
|
1161 | 1153 | /** Gets the ISchemaRegistry instances being used with this Graph. */ |
|
0 commit comments