Skip to content

Commit 5f8ad5f

Browse files
committed
Changed num_cores/num_chains to cores/chains
1 parent e8a8b6b commit 5f8ad5f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

knitr/reduce-sum/reduce_sum_tutorial.Rmd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Reduce Sum: A Minimal Example"
3-
date: "11 May 2020"
3+
date: "13 May 2020"
44
output: html_document
55
---
66

@@ -122,15 +122,16 @@ logistic0 <- cmdstan_model("logistic0.stan")
122122
```
123123

124124
To sample from the model run:
125-
125+
126126
```{r}
127127
time0 = system.time(fit0 <- logistic0$sample(redcard_data,
128-
num_cores = 4,
129-
num_chains = 4,
128+
cores = 4,
129+
chains = 4,
130130
refresh = 1000))
131131
132132
time0
133133
```
134+
**Note:** Older versions of cmdstanr use `num_cores` and `num_chains` instead of `cores` and `chains`. If you get an error, [update](https://mc-stan.org/cmdstanr/) `cmdstanr`.
134135

135136
In this case, we'll compute four chains using four cores. This computer has eight
136137
cores though, and we'll see how we can make use of those other cores later.
@@ -286,12 +287,13 @@ Run and time the model with:
286287
```{r}
287288
redcard_data$grainsize <- 1
288289
time1 = system.time(fit1 <- logistic1$sample(redcard_data,
289-
num_cores = 4,
290-
num_chains = 4,
290+
cores = 4,
291+
chains = 4,
291292
refresh = 1000))
292293
293294
time1
294295
```
296+
**Note:** Older versions of cmdstanr use `num_cores` and `num_chains` instead of `cores` and `chains`. If you get an error, [update](https://mc-stan.org/cmdstanr/) `cmdstanr`.
295297

296298
Again, `elapsed` time is the time recorded as if by a stopwatch. Computing the
297299
ratios of the two times gives the speedup on eight cores of:

0 commit comments

Comments
 (0)