Skip to content

Fix tests#455

Merged
amit-sharma merged 6 commits intointerpretml:mainfrom
CloseChoice:FIX-tests
May 25, 2025
Merged

Fix tests#455
amit-sharma merged 6 commits intointerpretml:mainfrom
CloseChoice:FIX-tests

Conversation

@CloseChoice
Copy link
Copy Markdown
Contributor

@CloseChoice CloseChoice commented May 14, 2025

This fixes the tests and should be backwards compatible.
The problem arose since in torch 2.6 (which is used for the tests) the weights_only parameter's default was changed from False to True which caused problems when loading the model. This PR fixes that.
Furthermore the output of self.transformer.transform(input_instance) contained booleans which cannot be cast to floats directly, therefore I do that manually

Also I updated the dice_genetic.py to handle 2d arrays correctly. Pls check whether this implementation is correct, I haven't had a look into the code and the functions in depth, just tried to guess what the code intends to do from the context.

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
@CloseChoice CloseChoice changed the title Fix pytorch tests Fix tests May 21, 2025
@amit-sharma
Copy link
Copy Markdown
Collaborator

this is great! thank you for fixing the tests, @CloseChoice

@amit-sharma amit-sharma merged commit 0c7e4d4 into interpretml:main May 25, 2025
20 checks passed
alanpar97 pushed a commit to alanpar97/DiCE that referenced this pull request May 27, 2025
* fix pytorch tests

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>

* fix tests

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>

* don't use formatting

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>

* fix issue

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>

* remove commented out code

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>

* simplify change

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>

---------

Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
@CloseChoice CloseChoice deleted the FIX-tests branch June 2, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants