fix: Resolve differences betweenjax_backend.concatenate
and other backends
#1655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves part of the
jax
component for #1654.This should make the behaviour consistent with numpy, e.g. when using a list as input. The perf slowdown in the trivial case (input ==
jax
array) is on the order of µs on my machine (8 core mbp) with an example 1D array of size 10.I made this PR purely for syntactical consistency -- of course, the slightly neater way may be to just always cast sequence-type inputs to tensors explicitly, so this isn't a hidden detail.
I couldn't think of a way to best test this consistency in the scope of this PR; if there was a suite that tested the output of common ops, then it fits nicely in there, but AFAIK you only test the core
pyhf
functionality instead.Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: