[Bug]: add default none value to axis parameter of the take_along_axis - #4357
Conversation
|
sorry for the extra whitespace removal, my editor removed it automatically :( |
|
THanks for looking into this! Could you please share a test case for this failure? |
|
done :) |
|
Sorry I meant: give me a command that does not work :) Thanks for the contribution! |
|
oh, my bad |
|
@nastya236 Hi, I just wanted to ask if it's ok to change the default value of the axis parameter to -1. It will make it comply with the array api spec https://data-apis.org/array-api/draft/API_specification/generated/array_api.take_along_axis.html#take-along-axis JAX and Numpy does the same. It's a backward breaking change but I don't think anyone will be affected as because of this bug, I think everyone had to explicitly pass an axis anyways so every old code would have an explict axis already defined. |
Proposed changes
Please include a description of the problem or feature this PR is addressing. If there is a corresponding issue, include the issue #.
fixes data-apis/array-api-compat#466
where
take_along_axisneeded axis to be passed even though docs says its default value was set to theNone, nb signature didn't set a default value thus failing in cases where no axis was provided.Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes