code: def siamese(
      layer: Model[LayerT, SimT],
      similarity: Model[Tuple[SimT, SimT], OutT],
  ) -> Model[InT, OutT]:
      return Model(
          f"siamese({layer.name}, {similarity.name})",
          forward,
          init=init,
          layers=[layer, similarity],
          dims={
              "nI": layer.get_dim("nI"),
              "nO": similarity.get_dim("nO"),
          },
      )
  
imports: from typing import Callable, Optional, Tuple, TypeVar
  from ..config import registry
  from ..model import Model
  from ..types import ArrayXd
  from ..util import get_width
label_desc: Use image node_id 1 for calling a global function with example usage: siamese(layer, similarity) and returns: Model