forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflatbuffer_serializer.h
33 lines (26 loc) · 1.01 KB
/
flatbuffer_serializer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#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,
const ExtraFilesMap& extra_files = ExtraFilesMap(),
const ExtraFilesMap& jit_sources = ExtraFilesMap(),
const std::vector<IValue>& jit_constants = {});
TORCH_API flatbuffers::DetachedBuffer save_mobile_module_to_bytes(
const mobile::Module& module,
const ExtraFilesMap& extra_files = ExtraFilesMap(),
const ExtraFilesMap& jit_sources = ExtraFilesMap(),
const std::vector<IValue>& jit_constants = {});
} // namespace jit
} // namespace torch