Add plt.close to avoid matplotlib warning
This commit is contained in:
parent
a886e53c54
commit
0d41bdae26
@ -12,6 +12,8 @@ from matplotlib.cm import ScalarMappable
|
|||||||
def plt_slices(*fields, size=64, title=None, cmap=None, norm=None):
|
def plt_slices(*fields, size=64, title=None, cmap=None, norm=None):
|
||||||
"""Plot slices of fields of more than 2 spatial dimensions.
|
"""Plot slices of fields of more than 2 spatial dimensions.
|
||||||
"""
|
"""
|
||||||
|
plt.close('all')
|
||||||
|
|
||||||
fields = [field.detach().cpu().numpy() if isinstance(field, torch.Tensor)
|
fields = [field.detach().cpu().numpy() if isinstance(field, torch.Tensor)
|
||||||
else field for field in fields]
|
else field for field in fields]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user