Components
Add

Add

Cumulatively add the forward results of the given modules in parallel.

Add(
    nn.Linear(100, 200),
    nn.Linear(100, 200),
    nn.Linear(100, 200)
)

Add inherits from the Sequential class and applies a list of modules in parallel, adding their forward results cumulatively. The output shapes of the given modules must be the same or broadcastable in order to be added.

Parameters

  • *args: Component instances whose forward results will be added cumulatively.

Forward

(x: torch.Tensor) -> torch.Tensor