Rate this Page

Struct Module#

Inheritance Relationships#

Base Type#

  • publicObject

Struct Documentation#

structModule:publicObject#

Public Functions

explicitModule(c10::QualifiedNameclass_name)#
Module(std::shared_ptr<CompilationUnit>cu,constc10::ClassTypePtr&type)#
Module()=default#
Module(constModule&)=default#
Module&operator=(constModule&)=default#
Module(Module&&)noexcept=default#
Module&operator=(Module&&)noexcept=default#
Module(c10::QualifiedName,std::shared_ptr<CompilationUnit>cu,boolshouldMangle=false)#
inlineModule(ModulePtrmodule_value)#
~Module()=default#
inlinevoidset_optimized(boolo)#
inlineboolis_optimized()const#
inlineIValueforward(std::vector<IValue>inputs,constKwargs&kwargs=Kwargs())#
inlinevoidregister_buffer(conststd::string&name,at::Tensorv)#
inlinevoidregister_parameter(conststd::string&name,at::Tensorv,boolis_buffer)#
inlinevoidregister_attribute(conststd::string&name,constTypePtr&t,IValuev,boolis_param=false,boolis_buffer=false)#
inlinevoidregister_module(conststd::string&name,constModule&module)#
voidapply(conststd::function<void(Module&)>&fn)#
buffer_listbuffers(boolrecurse=true)const#
named_buffer_listnamed_buffers(boolrecurse=true)const#
module_listchildren()const#
named_module_listnamed_children()const#
module_listmodules()const#
named_module_listnamed_modules()const#
parameter_listparameters(boolrecurse=true)const#
named_parameter_listnamed_parameters(boolrecurse=true)const#
attribute_listattributes(boolrecurse=true)const#
named_attribute_listnamed_attributes(boolrecurse=true)const#
voiddump(boolprint_method_bodies,boolprint_attr_values,boolprint_param_values)const#
std::stringdump_to_str(boolprint_method_bodies,boolprint_attr_values,boolprint_param_values)const#
voidtrain(boolon=true)#

Enables “training” mode.

inlinevoideval()#

Calls train(false) to enable “eval” mode.

Do not override this method, overridetrain() instead.

inlineboolis_training()const#

True if the module is in training mode.

voidto(at::Devicedevice,at::ScalarTypedtype,boolnon_blocking=false)#

Recursively casts all parameters to the givendtype anddevice.

Ifnon_blocking is true and the source is in pinned memory and destination is on the GPU or vice versa, the copy is performed asynchronously with respect to the host. Otherwise, the argument has no effect.

voidto(at::ScalarTypedtype,boolnon_blocking=false)#

Recursively casts all parameters to the given dtype.

Ifnon_blocking is true and the source is in pinned memory and destination is on the GPU or vice versa, the copy is performed asynchronously with respect to the host. Otherwise, the argument has no effect.

voidto(at::Devicedevice,boolnon_blocking=false)#

Recursively moves all parameters to the given device.

Ifnon_blocking is true and the source is in pinned memory and destination is on the GPU or vice versa, the copy is performed asynchronously with respect to the host. Otherwise, the argument has no effect.

voidsave(std::ostream&out,constExtraFilesMap&extra_files=ExtraFilesMap())const#
voidsave(conststd::string&filename,constExtraFilesMap&extra_files=ExtraFilesMap())const#
void_save_for_mobile(std::ostream&out,constExtraFilesMap&extra_files=ExtraFilesMap(),boolsave_mobile_debug_info=false,booluse_flatbuffer=false)const#
void_save_for_mobile(conststd::string&filename,constExtraFilesMap&extra_files=ExtraFilesMap(),boolsave_mobile_debug_info=false,booluse_flatbuffer=false)const#
Modulecopy()const#
Moduledeepcopy(std::optional<at::Device>device=std::nullopt)const#
Moduleclone(boolinplace=false)const#
Moduleclone(boolinplace,conststd::unordered_set<std::string>&ignored_method,conststd::unordered_set<std::string>&ignored_attributes)const#
voidclone_method(constModule&orig,conststd::string&name)#
IValueoperator()(std::vector<IValue>inputs)#
template<typename...Types>
inlineIValuecreate_class(constc10::QualifiedName&name,Types&&...args)const#
IValuecreate_class(constc10::QualifiedName&name,Stackstack)const#
inlinebooloperator==(constModule&y)constnoexcept#
inlinevoidset_delete_memory(std::shared_ptr<char>delete_mem)#
inlinevoidstore_traced_inputs(conststd::string&func_name,std::vector<IValue>inputs)#
inlinec10::Dict<std::string,c10::impl::GenericList>retrieve_traced_inputs()const#