Skip to content

Commit 6b1e18a

Browse files
committed
Add check for filter_size to be tuple
1 parent 37bccf0 commit 6b1e18a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ __pycache__
22
*.pyc
33
DeepFried2.egg-info/
44
examples/Kaggle-Otto/data/
5-
/build
6-
/dist
5+
build
6+
dist

DeepFried2/layers/SpatialConvolutionCUDNN.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ def __init__(self, nchan_in, nchan_out, filter_size, stride=1, border=0, mode='c
1313
# 3: https://github.com/vlfeat/matconvnet/blob/b7dd9c96/matlab/src/bits/impl/nnconv_cudnn.cu#L133
1414
# 4: https://github.com/BVLC/caffe/blob/50ab52cb/include/caffe/util/cudnn.hpp#L104
1515
df.Module.__init__(self)
16+
17+
# Catch a probably common bug while we transition the API.
18+
assert isinstance(filter_size, (list, tuple)), "New conv API: filter_size needs to be a tuple!"
19+
1620
self.nchan_in = nchan_in
1721
self.nchan_out = nchan_out
1822
self.filter_size = filter_size

0 commit comments

Comments
 (0)