mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/75256 ghstack-source-id: 153138970 Test Plan: CI Reviewed By: iseeyuan Differential Revision: D35399581 fbshipit-source-id: dafe9d301009d3f70986ed92bfe06d160ab90ba0 (cherry picked from commit ccc860fd07946de5aae12bc179a0b8bbba83b997)
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
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,
|
|
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 = {});
|
|
|
|
TORCH_API void save_jit_module(
|
|
const Module& module,
|
|
const std::string& filename,
|
|
const ExtraFilesMap& extra_files = ExtraFilesMap());
|
|
|
|
TORCH_API flatbuffers::DetachedBuffer save_jit_module_to_bytes(
|
|
const Module& module,
|
|
const ExtraFilesMap& extra_files = ExtraFilesMap());
|
|
|
|
TORCH_API Module parse_and_initialize_jit_module(
|
|
std::shared_ptr<char> data,
|
|
size_t size,
|
|
c10::optional<at::Device> device = c10::nullopt);
|
|
|
|
TORCH_API Module load_jit_module_from_file(
|
|
const std::string& filename,
|
|
c10::optional<at::Device> device = c10::nullopt);
|
|
|
|
TORCH_API Module load_jit_module_from_stream(
|
|
std::istream& in,
|
|
c10::optional<at::Device> device = c10::nullopt);
|
|
|
|
} // namespace jit
|
|
} // namespace torch
|