You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

model_options.h 1.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * \file lite/load_and_run/src/options/model_options.h
  3. *
  4. * This file is part of MegEngine, a deep learning framework developed by
  5. * Megvii.
  6. *
  7. * \copyright Copyright (c) 2020-2021 Megvii Inc. All rights reserved.
  8. */
  9. #pragma once
  10. #include <gflags/gflags.h>
  11. #include "megbrain/graph/operator_node.h"
  12. #include "models/model.h"
  13. #include "option_base.h"
  14. DECLARE_string(packed_model_dump);
  15. DECLARE_string(pack_info_json);
  16. DECLARE_string(pack_cache);
  17. DECLARE_string(pack_info_cryption);
  18. DECLARE_string(pack_model_cryption);
  19. namespace lar {
  20. class PackModelOption : public OptionBase {
  21. public:
  22. static bool is_valid();
  23. static std::shared_ptr<OptionBase> create_option();
  24. void config_model(
  25. RuntimeParam& runtime_param, std::shared_ptr<ModelBase> model) override;
  26. std::string option_name() const override { return m_option_name; }
  27. private:
  28. PackModelOption();
  29. template <typename ModelImpl>
  30. void config_model_internel(RuntimeParam&, std::shared_ptr<ModelImpl>);
  31. std::string m_option_name;
  32. std::string packed_model_dump;
  33. std::string pack_info_json;
  34. std::string pack_cache;
  35. std::string pack_binary_cache;
  36. std::string pack_info_cryption;
  37. std::string pack_model_cryption;
  38. bool is_fast_run_cache = true;
  39. };
  40. } // namespace lar