FunctionalCompositionModule

class FunctionalCompositionModule(*args, **kwargs)[source]

Bases: CompositionModule

Composition by a function (i.e. state-less).

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Methods Summary

forward(a, b)

Compose two batches of vectors.

Methods Documentation

forward(a: Tensor, b: Tensor) Tensor[source]

Compose two batches of vectors.

The tensors have to be broadcastable.

Parameters:
  • a (Tensor) – shape: s_1 The first tensor.

  • b (Tensor) – shape: s_2 The second tensor.

Returns:

shape: s

Return type:

Tensor