Rate this Page

Program Listing for File import.h#

Return to documentation for file (torch/csrc/jit/serialization/import.h)

#pragma once#include<ATen/core/ivalue.h>#include<caffe2/serialize/inline_container.h>#include<torch/csrc/jit/api/module.h>#include<torch/csrc/jit/ir/ir.h>#include<istream>namespacecaffe2::serialize{classReadAdapterInterface;}// namespace caffe2::serializenamespacetorch::jit{classDeserializationStorageContext;TORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,conststd::string&filename,std::optional<c10::Device>device=std::nullopt,boolload_debug_files=true);TORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,std::istream&in,std::optional<c10::Device>device=std::nullopt,boolload_debug_files=true);TORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,std::unique_ptr<caffe2::serialize::ReadAdapterInterface>rai,std::optional<c10::Device>device=std::nullopt,boolload_debug_files=true);TORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,conststd::string&filename,std::optional<c10::Device>device,ExtraFilesMap&extra_files,boolload_debug_files=true,boolrestore_shapes=false);// For reading unified serialization format from torch.PackageTORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,std::shared_ptr<caffe2::serialize::PyTorchStreamReader>reader,std::shared_ptr<torch::jit::DeserializationStorageContext>storage_context,std::optional<at::Device>device,conststd::string&ts_id/* torchscript identifier inside package */);TORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,std::istream&in,std::optional<c10::Device>device,ExtraFilesMap&extra_files,boolload_debug_files=true,boolrestore_shapes=false);TORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,std::unique_ptr<caffe2::serialize::ReadAdapterInterface>rai,std::optional<c10::Device>device,ExtraFilesMap&extra_files,boolload_debug_files=true);TORCH_APIModuleimport_ir_module(std::shared_ptr<CompilationUnit>cu,std::shared_ptr<caffe2::serialize::ReadAdapterInterface>rai,std::optional<c10::Device>device,ExtraFilesMap&extra_files,boolload_debug_files=true);TORCH_APIModuleload(std::istream&in,std::optional<c10::Device>device=std::nullopt,boolload_debug_files=true);TORCH_APIModuleload(std::istream&in,std::optional<c10::Device>device,ExtraFilesMap&extra_files,boolload_debug_files=true);TORCH_APIModuleload(conststd::string&filename,std::optional<c10::Device>device=std::nullopt,boolload_debug_files=true);TORCH_APIModuleload(conststd::string&filename,std::optional<c10::Device>device,ExtraFilesMap&extra_files,boolload_debug_files=true);TORCH_APIModuleload(std::shared_ptr<caffe2::serialize::ReadAdapterInterface>rai,std::optional<c10::Device>device=std::nullopt,boolload_debug_files=true);TORCH_APIModuleload(std::shared_ptr<caffe2::serialize::ReadAdapterInterface>rai,std::optional<c10::Device>device,ExtraFilesMap&extra_files,boolload_debug_files=true);TORCH_APIModulejitModuleFromSourceAndConstants(constIValue&ivalue,constExtraFilesMap&source,conststd::vector<IValue>&constants,int32_tversion);TORCH_APIModuleparse_and_initialize_jit_module(conststd::shared_ptr<char>&data,size_tsize,ExtraFilesMap&extra_files,std::optional<at::Device>device=std::nullopt);TORCH_APIModuleload_jit_module_from_file(conststd::string&filename,ExtraFilesMap&extra_files,std::optional<at::Device>device=std::nullopt);TORCH_APIModuleload_jit_module_from_stream(std::istream&in,ExtraFilesMap&extra_files,std::optional<at::Device>device=std::nullopt);TORCH_APIc10::intrusive_ptr<c10::ivalue::Object>ObjLoaderFunc(constat::StrongTypePtr&type,IValueinput);}// namespace torch::jit