Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions data_prep/baselines/GREAT/models/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ def positional_encoding(dim, sentence_length, dtype=tf.float32):
return tf.constant(encoded_vec.reshape([sentence_length, dim]), dtype=dtype)

def prefix_sum(arr):
res = [0]
for a in arr: res.append(res[-1] + a)
return res
return [0] + np.cumsum(arr).tolist()