class_docstr: ContextWithImage Module.
  
  Encodes image features and context, and combines by summing or concatenation.
class_docstr_tok: ["ContextWithImage","Module",".","Encodes","image","features","and","context",",","and","combines","by","summing","or","concatenation","."]
docstr: Handle concatenation of None tensors.
  
  Smart concatenation. Concatenates tensors if they are not None.
  
  :param tensors:
      A list of torch.Tensor, with at least one non-null object
  
  :return:
      The result of concatenating all non-null objects in tensors
docstr_tok: ["Handle","concatenation","of","None","tensors",".","Smart","concatenation",".","Concatenates","tensors","if","they","are","not","None",".",":","param","tensors",":","A","list","of","torch.Tensor",",","with","at","least","one","non-null","object",":","return",":","The","result","of","concatenating","all","non-null","objects","in","tensors"]
code: def _cat(self, tensors: List[Optional[torch.Tensor]]) -> torch.Tensor:
      """
      Handle concatenation of None tensors.
  
      Smart concatenation. Concatenates tensors if they are not None.
  
      :param tensors:
          A list of torch.Tensor, with at least one non-null object
  
      :return:
          The result of concatenating all non-null objects in tensors
      """
      non_null_tensors: List[torch.Tensor] = [
          t for t in tensors if t is not None
      ]
      return torch.cat([t for t in non_null_tensors], dim=1)
  
imports: from enum import Enum
  from functools import reduce
  from typing import List, Tuple, Optional, Union
  import torch
  import torch.nn
  from parlai.agents.transformer.modules import TransformerGeneratorModel, TransformerEncoder
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
label_desc: Use image node_id 8 for calling the ContextWithImageEncoder obj's underlying member method code with example usage: obj._cat(tensors) and returns: torch