Source code for kitcar_ml.utils.models.advanced_sequential
from torch import nn
[docs]class AdvancedSequential(nn.Sequential):
"""This module extends the pytorch module with the feature to give multiple inputs to
the forward functions."""
[docs] def forward(self, *input):
"""Forward inputs.
Allow passing multiple values in and iterate them through all models.
"""
for module in self:
input = module(*input)
return input