mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary:
Included functions:
* save_mobile_module -> saves a mobile::Module to flatbuffer
* load_mobile_module_from_file -> loads a flatbuffer into mobile::Module
* parse_mobile_module -> parses from bytes or deserialized flatbuffer
Module object
Fixes #{issue number}
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67351
Reviewed By: iseeyuan
Differential Revision: D32010095
Pulled By: qihqi
fbshipit-source-id: d763b0557780f7c2661b6485105b045e41a5e8f1
27 lines
710 B
C++
27 lines
710 B
C++
#pragma once
|
|
|
|
#include <ATen/core/qualified_name.h>
|
|
#include <flatbuffers/flatbuffers.h>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include <ATen/core/ivalue.h>
|
|
#include <ATen/core/jit_type.h>
|
|
#include <torch/csrc/jit/backends/backend_debug_handler.h>
|
|
#include <torch/csrc/jit/mobile/module.h>
|
|
#include <torch/csrc/jit/serialization/type_name_uniquer.h>
|
|
|
|
#include <torch/csrc/jit/serialization/mobile_bytecode_generated.h> // NOLINT
|
|
|
|
namespace torch {
|
|
namespace jit {
|
|
|
|
TORCH_API void save_mobile_module(
|
|
const mobile::Module& module,
|
|
const std::string& filename);
|
|
TORCH_API flatbuffers::DetachedBuffer save_mobile_module_to_bytes(
|
|
const mobile::Module& module);
|
|
|
|
} // namespace jit
|
|
} // namespace torch
|