Lkjcorr returning error

I’ve tried doing this with LKJCholeskyCov before, but it didn’t work for me. What am I doing wrong here?

def lkj(n, eta, size: TensorVariable,) -> TensorVariable:
    return pm.LKJCorr.dist(n=n, eta=eta, size=size)

with pm.Model(coords=coords) as m:
     
    sd_dist = pm.HalfCauchy.dist(1, shape=(n_groups, n_predictors))
    chol, corr, sigmas = pm.LKJCholeskyCov("L", eta=1, n=n_predictors, sd_dist=sd_dist)
    # chol, corr, sigmas = pm.LKJCholeskyCov("L", eta=1, n=n_predictors, sd_dist=sd_dist, shape=(n_groups,))
    likelihood = pm.MvNormal("likelihood", mu=0, chol=chol[group], observed=obs, dims=("obs_id", "predictors"))

with m:
    idata_prior = pm.sample_prior_predictive()
    # idata = pm.sample(tune=1000, draws=1000, nuts_sampler="numpyro")
{
	"name": "ValueError",
	"message": "Packed triangular is not one dimensional.",
	"stack": "---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/cao/projects/pymc_experiments/test.ipynb Cell 6 line 1
     <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/cao/projects/pymc_experiments/test.ipynb#X61sdnNjb2RlLXJlbW90ZQ%3D%3D?line=10'>11</a> with pm.Model(coords=coords) as m:
     <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/cao/projects/pymc_experiments/test.ipynb#X61sdnNjb2RlLXJlbW90ZQ%3D%3D?line=12'>13</a>     sd_dist = pm.HalfCauchy.dist(1, shape=(n_groups, n_predictors))
---> <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/cao/projects/pymc_experiments/test.ipynb#X61sdnNjb2RlLXJlbW90ZQ%3D%3D?line=13'>14</a>     chol, corr, sigmas = pm.LKJCholeskyCov(\"L\", eta=1, n=n_predictors, sd_dist=sd_dist)
     <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/cao/projects/pymc_experiments/test.ipynb#X61sdnNjb2RlLXJlbW90ZQ%3D%3D?line=14'>15</a>     likelihood = pm.MvNormal(\"likelihood\", mu=0, chol=chol[group], observed=obs, dims=(\"obs_id\", \"predictors\"))
     <a href='vscode-notebook-cell://wsl%2Bubuntu-20.04/home/cao/projects/pymc_experiments/test.ipynb#X61sdnNjb2RlLXJlbW90ZQ%3D%3D?line=16'>17</a> with m:

File ~/miniconda3/envs/pymc/lib/python3.11/site-packages/pymc/distributions/multivariate.py:1434, in LKJCholeskyCov.__new__(cls, name, eta, n, sd_dist, compute_corr, store_in_trace, **kwargs)
   1432     return packed_chol
   1433 else:
-> 1434     chol, corr, stds = cls.helper_deterministics(n, packed_chol)
   1435     if store_in_trace:
   1436         corr = pm.Deterministic(f\"{name}_corr\", corr)

File ~/miniconda3/envs/pymc/lib/python3.11/site-packages/pymc/distributions/multivariate.py:1451, in LKJCholeskyCov.helper_deterministics(cls, n, packed_chol)
   1449 @classmethod
   1450 def helper_deterministics(cls, n, packed_chol):
-> 1451     chol = pm.expand_packed_triangular(n, packed_chol, lower=True)
   1452     # compute covariance matrix
   1453     cov = pt.dot(chol, chol.T)

File ~/miniconda3/envs/pymc/lib/python3.11/site-packages/pymc/math.py:445, in expand_packed_triangular(n, packed, lower, diagonal_only)
    422 r\"\"\"Convert a packed triangular matrix into a two dimensional array.
    423 
    424 Triangular matrices can be stored with better space efficiency by
   (...)
    442     If true, return only the diagonal of the matrix.
    443 \"\"\"
    444 if packed.ndim != 1:
--> 445     raise ValueError(\"Packed triangular is not one dimensional.\")
    446 if not isinstance(n, int):
    447     raise TypeError(\"n must be an integer\")

ValueError: Packed triangular is not one dimensional."
}