Struct Module#
Defined inFile module.h
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(c10::QualifiedName,std::shared_ptr<CompilationUnit>cu,boolshouldMangle=false)#
- ~Module()=default#
- inlinevoidset_optimized(boolo)#
- inlineboolis_optimized()const#
- inlineIValueforward(std::vector<IValue>inputs,constKwargs&kwargs=Kwargs())#
- inlinevoidregister_attribute(conststd::string&name,constTypePtr&t,IValuev,boolis_param=false,boolis_buffer=false)#
- 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, override
train()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 given
dtypeanddevice.If
non_blockingis 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.
If
non_blockingis 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.
If
non_blockingis 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#
- Moduleclone(boolinplace,conststd::unordered_set<std::string>&ignored_method,conststd::unordered_set<std::string>&ignored_attributes)const#
- IValueoperator()(std::vector<IValue>inputs)#
- template<typename...Types>
inlineIValuecreate_class(constc10::QualifiedName&name,Types&&...args)const#
- IValuecreate_class(constc10::QualifiedName&name,Stackstack)const#
- inlinevoidset_delete_memory(std::shared_ptr<char>delete_mem)#
- inlinevoidstore_traced_inputs(conststd::string&func_name,std::vector<IValue>inputs)#
- explicitModule(c10::QualifiedNameclass_name)#