code: def get_combined_dim(combination, tensor_dims):
      """
      For use with :func:`combine_tensors`.  This function computes the resultant dimension when
      calling ``combine_tensors(combination, tensors)``, when the tensor dimension is known.  This is
      necessary for knowing the sizes of weight matrices when building models that use
      ``combine_tensors``.
  
      Parameters
      ----------
      combination : ``str``
          A comma-separated list of combination pieces, like ``"1,2,1*2"``, specified identically to
          ``combination`` in :func:`combine_tensors`.
      tensor_dims : ``List[int]``
          A list of tensor dimensions, where each dimension is from the `last axis` of the tensors
          that will be input to :func:`combine_tensors`.
      """
      if len(tensor_dims) > 9:
          raise ConfigurationError(
              "Double-digit tensor lists not currently supported"
          )
      combination = combination.replace("x", "1").replace("y", "2")
      return sum(
          [
              _get_combination_dim(piece, tensor_dims)
              for piece in combination.split(",")
          ]
      )
  
imports: from __future__ import division
  from __future__ import absolute_import
  from collections import defaultdict
  import logging
  import math
  import torch
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 22 for calling a global function with example usage: get_combined_dim(combination, tensor_dims) and returns: sum