code: def init(
      model: Model[InT, OutT],
      X: Optional[InT] = None,
      Y: Optional[OutT] = None,
  ) -> None:
      if X is not None:
          if model.has_dim("nI") is not False:
              model.set_dim("nI", get_width(X))
          for layer in model.layers:
              if layer.has_dim("nI") is not False:
                  layer.set_dim("nI", get_width(X))
      for layer in model.layers:
          layer.initialize(X=X, Y=Y)
      if all([layer.has_dim("nO") for layer in model.layers]):
          model.set_dim(
              "nO", sum(layer.get_dim("nO") for layer in model.layers)
          )
  
file_path: thinc/thinc/layers/concatenate.py
imports: from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, TypeVar, Union, cast
  from ..backends import NumpyOps
  from ..config import registry
  from ..model import Model
  from ..types import Array2d, Ragged, XY_XY_OutT
  from ..util import get_width
  from .noop import noop
label_desc: Use image node_id 6 for calling a global function with example usage: init(model, X, Y) without return types