continual.continual¶
- continual.continual(module)[source]¶
Convert a
torch.nn
module to a Continual Inference Network enhanced withforward_step
andforward_steps
.Modules may be either
torch.nn
Modules for which a corresponding module is implemented in this library (e.g.nn.Conv3d
), or atorch.nn
which can be naively mapped (e.g.nn.ReLU
).Custom modules can also be made continual by means of the
forward_stepping
function.Examples
coconv = co.continual(nn.Conv3d(3, 3, 3)) coseq = co.continual(nn.Sequential( nn.Conv3d(3, 3, 3), # Automatically converted as well! nn.ReLU() ))
- Return type: