GCN
- class GCN[source]
Bases:
Module- __init__(in_ft, out_ft, act, bias=True)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Methods
Initialize internal Module state, shared by both nn.Module and ScriptModule.
add_moduleAdd a child module to the current module.
applyApply
fnrecursively to every submodule (as returned by.children()) as well as self.bfloat16Casts all floating point parameters and buffers to
bfloat16datatype.buffersReturn an iterator over module buffers.
childrenReturn an iterator over immediate children modules.
compileCompile this Module's forward using
torch.compile().cpuMove all model parameters and buffers to the CPU.
cudaMove all model parameters and buffers to the GPU.
doubleCasts all floating point parameters and buffers to
doubledatatype.evalSet the module in evaluation mode.
extra_reprSet the extra representation of the module.
floatCasts all floating point parameters and buffers to
floatdatatype.Define the computation performed at every call.
get_bufferReturn the buffer given by
targetif it exists, otherwise throw an error.get_extra_stateReturn any extra state to include in the module's state_dict.
get_parameterReturn the parameter given by
targetif it exists, otherwise throw an error.get_submoduleReturn the submodule given by
targetif it exists, otherwise throw an error.halfCasts all floating point parameters and buffers to
halfdatatype.ipuMove all model parameters and buffers to the IPU.
load_state_dictCopy parameters and buffers from
state_dictinto this module and its descendants.modulesReturn an iterator over all modules in the network.
named_buffersReturn an iterator over module buffers, yielding both the name of the buffer as well as the buffer itself.
named_childrenReturn an iterator over immediate children modules, yielding both the name of the module as well as the module itself.
named_modulesReturn an iterator over all modules in the network, yielding both the name of the module as well as the module itself.
named_parametersReturn an iterator over module parameters, yielding both the name of the parameter as well as the parameter itself.
parametersReturn an iterator over module parameters.
register_backward_hookRegister a backward hook on the module.
register_bufferAdd a buffer to the module.
register_forward_hookRegister a forward hook on the module.
register_forward_pre_hookRegister a forward pre-hook on the module.
register_full_backward_hookRegister a backward hook on the module.
register_full_backward_pre_hookRegister a backward pre-hook on the module.
register_load_state_dict_post_hookRegister a post hook to be run after module's
load_state_dictis called.register_moduleAlias for
add_module().register_parameterAdd a parameter to the module.
register_state_dict_pre_hookRegister a pre-hook for the
load_state_dict()method.requires_grad_Change if autograd should record operations on parameters in this module.
set_extra_stateSet extra state contained in the loaded state_dict.
share_memorySee
torch.Tensor.share_memory_().state_dictReturn a dictionary containing references to the whole state of the module.
toMove and/or cast the parameters and buffers.
to_emptyMove the parameters and buffers to the specified device without copying storage.
trainSet the module in training mode.
typeCasts all parameters and buffers to
dst_type.xpuMove all model parameters and buffers to the XPU.
zero_gradReset gradients of all model parameters.
Attributes
T_destinationcall_super_initdump_patchestraining- forward(seq, adj)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.