Skip to content

Probability test framework doesn't clean up memory properly #2036

@bbbales2

Description

@bbbales2

Description

Various calculate gradients functions get called in a row, for instance here. The problem is that some of these functions call stan::recover_memory and so are clearing off the autodiff stack that will get used later (here and here).

For instance, when testing fvar<var> values, the sequence here recovers memory on the first call and then calls grad in the subsequent two calls:

calculate_gradients_1storder(expected_gradients1, logprob_funct, x1);
calculate_gradients_1storder(gradients1, logprob, y1);
calculate_gradients_2ndorder(expected_gradients2, logprob_funct, x2);

Current Version:

v3.3.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions