ConcatCombination

class ConcatCombination(dim: int = -1)[source]

Bases: Combination

Combine representation by concatenation.

Initialize the combination.

Parameters:

dim (int) – the concatenation dimension

Methods Summary

forward(xs)

Combine a sequence of individual representations.

iter_extra_repr()

Iterate over the components of the extra_repr().

Methods Documentation

forward(xs: Sequence[Tensor]) Tensor[source]

Combine a sequence of individual representations.

Parameters:

xs (Sequence[Tensor]) – shape: (*batch_dims, *input_dims_i) the individual representations

Returns:

shape: (*batch_dims, *output_dims) a combined representation

Return type:

Tensor

iter_extra_repr() Iterable[str][source]

Iterate over the components of the extra_repr().

This method is typically overridden. A common pattern would be

def iter_extra_repr(self) -> Iterable[str]:
    yield from super().iter_extra_repr()
    yield "<key1>=<value1>"
    yield "<key2>=<value2>"
Returns:

an iterable over individual components of the extra_repr()

Return type:

Iterable[str]