code: def forward(
      self, inputs: torch.Tensor, seq_lengths: torch.Tensor = None
  ) -> torch.Tensor:
      max_len = inputs.size()[1]
      if self.boundary_type == "first":
          return inputs[:, 0, :]
      elif self.boundary_type == "last":
          # could only have the bos values if add_bos or add_eos as False
          # should not reach here if the eos is not added.
          assert max_len > 1
          return inputs[:, max_len - 1, :]
      elif self.boundary_type == "firstlast":
          assert max_len > 1
          # merge from embed_dim into 2*emded_dim
          return torch.cat(
              (inputs[:, 0, :], inputs[:, max_len - 1, :]), dim=1
          )
      else:
          raise Exception(
              "Unknown configuration type {}".format(self.boundary_type)
          )
  
imports: import torch
  import torch.nn
  import torch.onnx.operators
  from pytext.config import ConfigBase
  from pytext.models.module import Module
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 2 for calling the BoundaryPool obj's underlying member method code with example usage: obj.forward(inputs, seq_lengths) and returns: inputs, inputs, torch