class_docstr: a custom module for concatenation of tensors
class_docstr_tok: ["a","custom","module","for","concatenation","of","tensors"]
code: def forward(self, *input_args):
      # we have a single object
      if len(input_args) == 1:
          # regardless of type,
          # we don't care about single objects
          # we just index into the object
          input_args = input_args[0]
  
      # don't concat things that are just single objects
      if torch.is_tensor(input_args):
          return input_args
      else:
          if self.allow_broadcast:
              shape = broadcast_shape(
                  *[s.shape[:-1] for s in input_args]
              ) + (-1,)
              input_args = [s.expand(shape) for s in input_args]
          return torch.cat(input_args, dim=-1)
  
imports: from inspect import isclass
  import torch
  import torch.nn
  from pyro.distributions.util import broadcast_shape
label_desc: Use image node_id 2 for calling the ConcatModule obj's underlying member method code with example usage: obj.forward() and returns: input_args, torch