PAIR-code / saliency

Framework-agnostic implementation for state-of-the-art saliency methods (XRAI, BlurIG, SmoothGrad, and more).
https://pair-code.github.io/saliency/
Apache License 2.0
953 stars 191 forks source link

Remove empty dictionary as a default argument in GetMask #51

Closed bwedin closed 3 years ago

bwedin commented 3 years ago

The GetMask function currently uses an empty dictionary as the default argument for feed_dict. This is potentially dangerous, as the global variable may be edited during a run of GetMask. We should change the default value to None and only pass the feed_dict argument when it is specified by the user.

bwedin commented 3 years ago

For what it's worth, the default feed_dict argument is also None, so this should be a very minor change.

bwedin commented 3 years ago

Fixed in https://github.com/PAIR-code/saliency/pull/77