-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix typo in ShapeDtypeStruct #2253
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
Conversation
Actually this problem is more complicated than I though. Could it be that numpy dtypes and jax dtype's are different? |
cc @tomhennigan It's a bit tricky to get these right, since there are several different types referred to as 'dtype'. Without looking at it closely, one guess is we could try |
I think the test in |
97a88f6
to
f311557
Compare
Thanks @mattjj and @tomhennigan the suggested solution seems to work correctly. I can't really think of another edge case at this point and the tests pass. |
I actually think that there is real confusion between There is a bug in BTW, the alternative |
@jheek When you get a chance, can you please take a look at the latest comments? |
Most of the jax api accepts both numpy dtypes and jax dtypes, if I'm correct. Because ShapeDtypeStruct can be constructed by users I think it's best to have a fix that allows both flavours of dtypes to be used. |
If we do want to allow flexibility for the constructor, how do you feel about adding the |
@jheek PTAL at my suggestion |
In the meantime, I'm using this patch. This may be inconsistent between np.dtype/jnp.dtype but at least it allow to
|
@gnecula yes I agree that makes more sense and it seems to work correctly. |
seems like I made a mistake when pushing changes. Should be good now |
Fixes #2320 |
* fix ShapeDtypeSTruct dtype bug * move dtype conversion to constructor
ShapeDtypeStruct.__repr__
has a typeself.dtype.dtype.name
should beself.dtype.name