Skip to content

Commit

Permalink
needleman_wunsch
Browse files Browse the repository at this point in the history
  • Loading branch information
0x00b1 committed Apr 29, 2024
1 parent c174a4e commit 72c3287
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/beignet/operators/_needleman_wunsch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import math
import operator

import matplotlib.pyplot
import numpy.random
import torch
import torch.func
import torch.nn.functional
Expand Down Expand Up @@ -194,16 +192,3 @@ def fn(x: Tensor, shape: Tensor) -> Tensor:
output[index] = torch.func.grad(fn)(input[index], lengths[index])

return output


def test():
x = torch.tensor(numpy.random.random((32, 8, 8)), device="cpu")

lengths = torch.full([32, 2], 8, device="cpu")

alignment = needleman_wunsch(x, lengths, -1.0, 1.0)[0]

matplotlib.pyplot.imshow(alignment.cpu().numpy())


test()

0 comments on commit 72c3287

Please sign in to comment.