Skip to content

issue with constraint_logpdf(auxdata, pars) #1608

Discussion options

You must be logged in to vote

@IzaV10 Sorry I missed this — just seeing it now. The problem is that pyhf.pdf.Model.constraint_logpdf requires tensor objects and your inits is a list. I understand your confusion as to why logpdf works but constraint_logpdf doesn't and that's our fault for making sure that some parts of the API will work even with non-tensors when we should strictly enforce tensors everywhere.

The good news is that this is very simple to fix: just wrap your inits in pyhf.tensorlib.astensor.

As a full example of this, if we take the "Hello World" example from the README and modify it a bit

# discussion_1608.py 
import pyhf

pyhf.set_backend("jax")

model = pyhf.simplemodels.uncorrelated_background(
    s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kratsg
Comment options

Answer selected by matthewfeickert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants