Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
rodluger committed Sep 14, 2020
1 parent 4c25e9a commit 160cc49
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions tests/test_segfault.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
sizes = [10, 100, 1000, 10000, 100000]


@pytest.mark.parametrize("M", sizes)
def test_dot_product(M, N=300, L=1):
def dot_product():
U = tt.ones((M, N))
V = tt.ones((N, L))
dot = tt.dot(U, V)
return tt.sum(dot) / (M * N * L)
def dot_sum(x, y):
dot = tt.dot(x, y)
return tt.sum(dot)


x = tt.dmatrix()
y = tt.dmatrix()
func = theano.function([x, y], dot_sum(x, y))

func = theano.function([], dot_product())
print(func())

@pytest.mark.parametrize("M", sizes)
def test_dot_product(M, N=300, L=10):
u = np.random.randn(M, N)
v = np.random.randn(N, L)
print(func(u, v))

0 comments on commit 160cc49

Please sign in to comment.