pytorch / captum

Model interpretability and understanding for PyTorch
https://captum.ai
BSD 3-Clause "New" or "Revised" License
4.94k stars 499 forks source link

Fix mypy issue in visualization.py #1416

Closed craymichael closed 3 weeks ago

craymichael commented 3 weeks ago

Summary: visualize_image_attr_multiple can return a List[Axes], adds proper annotations to satisfy mypy

Why casting is necessary: https://github.com/numpy/numpy/issues/24738

https://github.com/matplotlib/matplotlib/blob/v3.9.2/lib/matplotlib/pyplot.py#L1583C41-L1584C1

Differential Revision: D64998799

facebook-github-bot commented 3 weeks ago

This pull request was exported from Phabricator. Differential Revision: D64998799

facebook-github-bot commented 3 weeks ago

This pull request was exported from Phabricator. Differential Revision: D64998799

facebook-github-bot commented 3 weeks ago

This pull request was exported from Phabricator. Differential Revision: D64998799

facebook-github-bot commented 3 weeks ago

This pull request was exported from Phabricator. Differential Revision: D64998799

facebook-github-bot commented 3 weeks ago

This pull request was exported from Phabricator. Differential Revision: D64998799

facebook-github-bot commented 3 weeks ago

This pull request has been merged in pytorch/captum@dff8473fc96d0c6d00440053c09018bf3915661b.