-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support vanilla lists when the default backend is non-numpy #1654
Comments
@kratsg @phinate can you comment a bit more on the specifics of what is causing this problem and/or create a public workspace that will fail for this? If I take the workspaces from Discussion #1695 import json
import pyhf
if __name__ == "__main__":
with open("NormalMeasurement_combined.json") as read_file:
workspace_json = json.load(read_file)
backends = ["numpy", "jax", "pytorch", "tensorflow"]
for backend in backends:
print(f"\n{backend}")
pyhf.set_backend(backend)
workspace = pyhf.Workspace(workspace_json)
model = workspace.model()
assert model is not None those are fine, so can you summarize in the Issue what the problems are that you're encountering in Issue #1646 and PR #1655. |
No problem -- the issue arises when using the new The specific problem I found was to do with
Code examples: import numpy as np
np.concatenate([[4,5], [3]])
> array([4, 5, 3])
import jax.numpy as jnp
jnp.concatenate(jnp.array([[4,5], [3]]))
> /home/jovyan/.local/lib/python3.8/site-packages/jax/_src/numpy/lax_numpy.py:476: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
arr = np.array(obj, dtype=dtype, **kwargs)
... (leaving out long stack trace)
TypeError: JAX only supports number and bool dtypes, got dtype object in array This happens in Hope this makes sense! @lukasheinrich was also encountering these things while working on #1676, so he may also have comments or a resolution :) |
(Make builders diffable)
#1646 will pull out a bug that we somewhat have in our code about assumptions of the default backend... we'll need to fix this.
This is just revealing an underlying feature we never actually supported
Originally posted by @kratsg in #1646 (comment)
The text was updated successfully, but these errors were encountered: