Skip to content

Commit 6a65742

Browse files
authored
Make matplotlib lazy (#134)
stack-info: PR: #134, branch: drisspg/stack/9
1 parent 15201f4 commit 6a65742

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

attn_gym/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import torch
22
from typing import Optional
3-
import matplotlib.pyplot as plt
43
from pathlib import Path
54
import numpy as np
65
import math
@@ -100,6 +99,8 @@ def visualize_attention_scores(
10099
Returns:
101100
None
102101
"""
102+
import matplotlib.pyplot as plt
103+
103104
assert score_mod is not None or mask_mod is not None, (
104105
"Must provide either score_mod or mask_mod"
105106
)

0 commit comments

Comments
 (0)