code: def forward(
      self, inputs: ElementsToSummaryRepresentationInput
  ) -> torch.Tensor:
      attention_scores = self.__attention_layer(
          inputs.element_embeddings
      ).squeeze(
          -1
      )  # [num_elements]
      attention_probs = torch.exp(
          scatter_log_softmax(
              attention_scores,
              index=inputs.element_to_sample_map,
              dim=0,
              eps=0,
          )
      )  # [num_elements]
      return scatter_sum(
          self.__output_layer(inputs.element_embeddings)
          * attention_probs.unsqueeze(-1),
          index=inputs.num_samples,
          dim=0,
          dim_size=inputs.num_samples,
      )
  
imports: from typing_extensions import Literal
  import torch
  from abc import abstractmethod
  from math import sqrt
  from torch import nn
  from torch_scatter import scatter, scatter_log_softmax, scatter_sum
  from typing import NamedTuple, Union
label_desc: Use image node_id 2 for calling the NormalizedWeightsVarSizedElementReduce obj's underlying member method code with example usage: obj.forward(inputs) and returns: scatter_sum