File size: 293 Bytes
2d5fdd1
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9

in /home/guillefix/.local/lib/python3.7/site-packages/torch/nn/functional.py, add 

np.save("analysis/weight_mats/"+str(uuid.uuid4())+".np",attn_output_weights.cpu().numpy())

before the line attn_output_weights = softmax(attn_output_weights, dim=-1)

and import numpy as np, and import uuid