Skip to content

dims(x) on array[ , ] vector[ ] x outputs a size 4 array instead of size 3 #3273

Open

Description

@spinkney
// 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] 

Activity

  1. deveshvaidyaofficial commented on Oct 23, 2026

    @deveshvaidyaofficial

    Working on this issue , raising a PR soon

  2. deveshvaidyaofficial commented on Oct 23, 2026

    @deveshvaidyaofficial

    Have raised PR #3482 for closing this issue
    Would request the maintainers to mark this as a Bug Fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions