Skip to content

Commit

Permalink
Merge pull request #60 from stan-dev/optimizer-specific-tests
Browse files Browse the repository at this point in the history
Add test models specific to stanc3 optimizer
  • Loading branch information
WardBrian authored Nov 28, 2023
2 parents 1bf8f2f + 7291052 commit ebb83e7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions optimizer-stress-models/inline-tdata.stan
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
functions {
matrix foo(int N, int M){
return rep_matrix(1, N, M);
}
}

transformed data {
int N = 10;
int M = 11;
matrix[N,M] bar = foo(N, M);
}

parameters {
real alpha;
}

model {
sum(bar) ~ normal(alpha, 0.1);
}
13 changes: 13 additions & 0 deletions optimizer-stress-models/soa-index.stan
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters {
vector[3] y;
array[3] vector[4] arr_vec;
}
transformed parameters {
vector[3] x = y[1 : 3];
}
model {
x ~ std_normal();
for (i in 1 : 3) {
arr_vec[i] ~ std_normal();
}
}
2 changes: 2 additions & 0 deletions optimizer.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
optimizer-stress-models/inline-tdata.stan
optimizer-stress-models/soa-index.stan, 1000

0 comments on commit ebb83e7

Please sign in to comment.