Songwei Ge commited on
Commit
f6e53b7
1 Parent(s): 9ffa534
Files changed (1) hide show
  1. utils/attention_utils.py +1 -1
utils/attention_utils.py CHANGED
@@ -181,5 +181,5 @@ def get_token_maps(attention_maps, save_dir, width, height, obj_tokens, seed=0,
181
  token_maps_vis = plot_attention_maps([attention_maps_averaged, attention_maps_averaged_normalized],
182
  obj_tokens, save_dir, seed, tokens_vis)
183
  attention_maps_averaged_normalized = [attn_mask.unsqueeze(1).repeat(
184
- [1, 4, 1, 1]).to(attention_maps_averaged_sum.device) for attn_mask in attention_maps_averaged_normalized]
185
  return attention_maps_averaged_normalized, token_maps_vis
 
181
  token_maps_vis = plot_attention_maps([attention_maps_averaged, attention_maps_averaged_normalized],
182
  obj_tokens, save_dir, seed, tokens_vis)
183
  attention_maps_averaged_normalized = [attn_mask.unsqueeze(1).repeat(
184
+ [1, 4, 1, 1]).cuda() for attn_mask in attention_maps_averaged_normalized]
185
  return attention_maps_averaged_normalized, token_maps_vis