Skip to content

Commit 85c83e3

Browse files
committed
cleanup
1 parent 3411b76 commit 85c83e3

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

memory_efficient_attention_pytorch/memory_efficient_attention.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ def attention(
4545

4646
# memory efficient attention
4747

48-
def safe_sum(acc, el):
49-
if not exists(acc):
50-
return el
51-
return acc + el
52-
5348
def summarize_qkv_chunk(q, k, v, mask, causal_mask):
5449
weight = einsum('b h i d, b h j d -> b h i j', q, k)
5550
weight_max = weight.amax(dim = -1, keepdim = True).detach()

0 commit comments

Comments
 (0)