Skip to content

Commit

Permalink
removed unnecessary deparse
Browse files Browse the repository at this point in the history
  • Loading branch information
danielturek committed Jun 2, 2024
1 parent 89c4865 commit d93b039
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nimbleHMC/R/HMC_samplers.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ hmc_checkTarget <- function(model, targetNodes, hmcType) {
dists <- targetDists_unique
ADok <- rep(TRUE, length(dists))
for(i in seq_along(dists)) {
dist_deparsed <- deparse(dists[i])
ADoak[i] <- model$getModelDef()$checkADsupportForDistribution(dist_deparsed)
ADoak[i] <- model$getModelDef()$checkADsupportForDistribution(dists[i])
}
if(!all(ADok))
stop(paste0(hmcType, ' sampler cannot operate on user-defined distributions which do not support AD calculations. Try using buildDerivs = TRUE in the definition the distributions: ', paste0(dists[!ADok], collapse = ', ')))
Expand Down

0 comments on commit d93b039

Please sign in to comment.