Skip to content

module core.module

Global Variables

  • TYPE_CHECKING

class ModuleNode

a node that extends torch.nn.Module

ModuleNode manages neural network modules (torch.nn.Module) and the optimizers responsible to train them. For each ModuleNode, multiple optimizers can be specified, each of which can be responsible for different group of parameters by filtering parameters names.

Multiple ModelNode with different training configuration under differnt tags can share a same torch.nn.Module.

method __init__

__init__(*args, **kwds)  None

property board

the board writer of current task.


property device

the assigned device by current launcher.


property epoch_size

the size of current epoch.


property epoch_steps

the steps of current epoch.


property global_auto_steps

the global steps of current task.


property global_train_epochs

the global train epochs of current task.


property global_train_steps

the global train steps of current task.


property grad_acc_steps

the grad accumulator steps of current task.


property grad_scaler

the grad scaler of current task.


property launcher

the current launcher.


property name

the node name in the current activated ExecutableGraph.


property out_dir

the output directory of current task.


property run_id

the run id of current task.


property step_mode

whether current task is running by step (True) or by epoch (False).


property task

the current task.


property training

whether current task is training.


method epoch_end

epoch_end()

method epoch_start

epoch_start()

method forward_impl

forward_impl(cache: "'GraphOutputCache'")

method load_state_dict

load_state_dict(_state_dict: 'Dict', strict: 'bool')

method prepare

prepare()

method state_dict

state_dict()

method update

update()