code: def _expand_param(
      p: Tensor, num_samples: Optional[int] = None
  ) -> Tensor:
      """
      Expand parameters by num_samples along the first dimension.
      """
      if num_samples is None:
          return p
      return p.expand_dims(axis=0).repeat(axis=0, repeats=num_samples)
  
imports: from typing import cast, Any, List, Optional, Tuple
  import mxnet
  import numpy
  from mxnet import autograd
  from gluonts.mx import Tensor
label_desc: Use image node_id 5 for calling a global function with example usage: _expand_param(p, num_samples) and returns: p, p