MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / plot_att

Function plot_att

model/transformer_branch.py:62–71  ·  view source on GitHub ↗
(att_tensor, T)

Source from the content-addressed store, hash-verified

60# Core DiT Model #
61#################################################################################
62def plot_att(att_tensor, T):
63
64 att_arr = att_tensor.detach().cpu().numpy()[0][0]
65 time_str = str(time.time())[-5:]
66 filename = 'atten_map/ours/fig/' + time_str + '_' +str(T[0].item()) + '.png'
67 arr_name = 'atten_map/ours/arr/' + time_str + '_' +str(T[0].item()) + '.npy'
68 ax = sns.heatmap(att_arr)
69 plt.savefig(filename)
70 np.save(arr_name, att_arr)
71 plt.clf()
72
73
74class Attention(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected