1/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15#ifndef TENSORFLOW_LITE_TOCO_MODEL_CMDLINE_FLAGS_H_
16#define TENSORFLOW_LITE_TOCO_MODEL_CMDLINE_FLAGS_H_
17
18#include <string>
19#include <unordered_map>
20#include <vector>
21
22#include "tensorflow/lite/toco/args.h"
23#include "tensorflow/lite/toco/model_flags.pb.h"
24#include "tensorflow/lite/toco/types.pb.h"
25
26namespace toco {
27// Parse and remove arguments for models (in toco). Returns true if parsing
28// is successful. msg has the usage string if there was an error or
29// "--help" was specified
30bool ParseModelFlagsFromCommandLineFlags(
31 int* argc, char* argv[], std::string* msg,
32 ParsedModelFlags* parsed_model_flags_ptr);
33// Populate the ModelFlags proto with model data.
34void ReadModelFlagsFromCommandLineFlags(
35 const ParsedModelFlags& parsed_model_flags, ModelFlags* model_flags);
36// Parse the global model flags to a static
37void ParseModelFlagsOrDie(int* argc, char* argv[]);
38// Get the global parsed model flags
39ParsedModelFlags* GlobalParsedModelFlags();
40
41} // namespace toco
42
43#endif // TENSORFLOW_LITE_TOCO_MODEL_CMDLINE_FLAGS_H_
44