code: def forward(self, unpooled, input_mask):
      # [batch_size, length, hidden_dim]
      assert len(unpooled.shape) == 3
      # [batch_size, length]
      assert len(input_mask.shape) == 2
      lengths = input_mask.sum(dim=1).float()
      summed = (unpooled * input_mask.float().unsqueeze(2)).sum(1)
      return summed / lengths.unsqueeze(1)
  
imports: from __future__ import annotations
  import abc
  import torch
  import torch.nn
  import transformers
  from jiant.ext.allennlp import SelfAttentiveSpanExtractor
  from jiant.shared.model_resolution import ModelArchitectures
  from jiant.tasks.core import TaskTypes
  from typing import Callable
  from typing import List
label_desc: Use image node_id 2 for calling the MeanPoolerHead obj's underlying member method code with example usage: obj.forward(unpooled, input_mask) and returns: unknown