`dims(x)` on `array[ , ] vector[ ] x` outputs a size 4 array instead of size 3
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 839
- Forks
- 220
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 14
Description
// test_dims.stan
data {
}
parameters {
array[1, 1] vector[1] x;
}
transformed parameters {
print("dims(x): ", dims(x));
}
model {
x[1, 1, 1] ~ std_normal();
}
Using cmdstan 2.38
library(cmdstanr)
mod_test <- cmdstan_model("test_dims.stan")
mod_test$sample()
Output
Chain 3 dims(x): [1,1,1,1]
Chain 3 dims(x): [1,1,1,1]
Chain 3 dims(x): [1,1,1,1]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied test_dims.stan example through cmdstanr and confirm that dims(x) prints four entries instead of three. Trace the dims(x) handling for the declared array[1, 1] vector[1] x type, then verify that the output reports the expected three dimensions while the model still samples successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100