CI Fix TransformTargetRegressor metadata routing test - #34371
Conversation
Instead of using np.empty() which can return an array of only zeros we use np.ones() for the weights. A completely empty array triggers a sanity check that not all weights are zero.
|
I pushed an empty commit to ensure that this fix the problem on the free-threaded builds. |
ogrisel
left a comment
There was a problem hiding this comment.
LGTM. Will mark as auto-merge.
|
The CD build passed. There is still a failure with the |
Interesting. I think the values an |
I wondered the same and asked AI to comb through our tests. The result of that is #34373 so it looks like the answer to your question is that generally we do use |
That's good enough for me, since we didn't detect any other failures. Thanks. |
…#34371) Co-authored-by: Olivier Grisel <[email protected]>
…#34371) Co-authored-by: Olivier Grisel <[email protected]>
Reference Issues/PRs
Fix for the latest failure in #32393 (That is a mega issue that keeps running. So I am not sure if we should close it when merging this PR?)
What does this implement/fix? Explain your changes.
Instead of using
np.empty()the test now usesnp.ones(). On macosnp.empty()seems to reliably return an array that contains only zeros, this fails a check that not all weights are zero. I think we don't care about the values of the weights, at least I hope we don't care given that we usednp.empty. So usingnp.onesshould be fine as well.For some reason
np.emptyreturns something that contains at least one element that isn't zero when we run the test in the normal PR CI. I guess that is "expected" becausenp.emptysays it will return a new array without initialising the entries. Uninitialised memory -> no one knows what is/isn't in that memory. I'm not sure if free-threaded vs not free-threaded has anything to do with it?My conclusion, if we look at the contents of an array we should probably not use
np.empty.AI usage disclosure
I used AI assistance for:
My AI researcher thinks that #32212 and #34224 "conspired" to cause this.
cc @lucyleeow