    def forward(self, inputs: torch.Tensor, mask: torch.BoolTensor) -> Dict[str, torch.Tensor]:
        """
        Compute context insensitive token embeddings for ELMo representations.

        # Parameters

        inputs: `torch.Tensor`
            Shape `(batch_size, num_characters, embedding_dim)`
            Character embeddings representing the current batch.
        mask: `torch.BoolTensor`
            Shape `(batch_size, num_characters)`
            Currently unused. The mask for characters is implicit. See TokenCharactersEncoder.forward.

        # Returns

        `encoding`:
            Shape `(batch_size, projection_dim)` tensor with context-insensitive token representations.
        """
        # convolutions want (batch_size, embedding_dim, num_characters)
        inputs = inputs.transpose(1, 2)

        convolutions = []
        for i in range(len(self._convolutions)):
            char_conv_i = getattr(self, f"char_conv_{i}")
            convolved = char_conv_i(inputs)

            # (batch_size, n_filters for this width)
            convolved, _ = torch.max(convolved, dim=-1)
            convolved = self._activation(convolved)
            convolutions.append(convolved)

        # (batch_size, n_filters)
        token_embedding = torch.cat(convolutions, dim=-1)

        if self._projection_location == "after_cnn":
            token_embedding = self._projection(token_embedding)

        # apply the highway layers (batch_size, highway_dim)
        token_embedding = self._highways(token_embedding)

        if self._projection_location == "after_highway":
            # final projection  (batch_size, projection_dim)
            token_embedding = self._projection(token_embedding)

        # Apply layer norm if appropriate
        token_embedding = self._layer_norm(token_embedding)

        return token_embedding
Compute context insensitive token embeddings for ELMo representations.

# Parameters

inputs: `torch.Tensor`
Shape `(batch_size, num_characters, embedding_dim)`
Character embeddings representing the current batch.
mask: `torch.BoolTensor`
Shape `(batch_size, num_characters)`
Currently unused. The mask for characters is implicit. See TokenCharactersEncoder.forward.

# Returns

`encoding`:
Shape `(batch_size, projection_dim)` tensor with context-insensitive token representations.
allennlp/modules/seq2vec_encoders/cnn_highway_encoder.py