def _getExpandedField(self, key, dims, K=None, doExpandD=False):
    if K is None:
      K = self.K
    arr = getattr(self, key)
    if arr.ndim < len(dims):
      for dimID, dimName in enumerate(dims):      
        if dimName == 'K' and K == 1:
          arr = np.expand_dims(arr, axis=dimID)
        elif getattr(self, dimName) == 1 and doExpandD:
          arr = np.expand_dims(arr, axis=dimID)
    return arr
Returns array expanded from squeezed form.
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/suffstats/ParamBag.py/ParamBag._getExpandedField