#if !defined(C10_MOBILE) && !defined(ANDROID) #pragma once #include #include #include namespace torch::inductor { class TORCH_API AOTIModelPackageLoader { public: AOTIModelPackageLoader( const std::string& model_package_path, const std::string& model_name = "model", const bool run_single_threaded = false, const size_t num_runners = 1, const c10::DeviceIndex device_index = -1); ~AOTIModelPackageLoader(); AOTIModelContainerRunner* get_runner(); std::unordered_map get_metadata(); std::vector run( const std::vector& inputs, void* stream_handle = nullptr); // boxed_run will steal the ownership of the input tensors std::vector boxed_run( std::vector&& inputs, void* stream_handle = nullptr); std::vector get_call_spec(); void load_constants( std::unordered_map& constants_map, bool use_inactive, bool check_full_update, bool user_managed = false); std::vector get_constant_fqns(); void update_constant_buffer( std::unordered_map& tensor_map, bool use_inactive, bool validate_full_updates, bool user_managed = false); private: std::string temp_dir_; std::unique_ptr runner_; std::unordered_map metadata_; void load_metadata(const std::string& cpp_filename); }; } // namespace torch::inductor #endif