Skip to content

Commit e500a27

Browse files
committed
Fix int64 casting directly in make_node() method.
1 parent f0744c0 commit e500a27

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

theano/gpuarray/dnn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,9 @@ def __init__(self, border_mode, subsample=(1, 1), conv_mode='conv',
385385
self.precision = precision
386386

387387
def make_node(self, kern_shape):
388-
if kern_shape.type.ndim != 1 or kern_shape.type.dtype != 'int64':
388+
if kern_shape.type.ndim != 1 or kern_shape.dtype not in theano.tensor.basic.int_dtypes:
389389
raise TypeError('kern must be an int64 1D shape tensor')
390+
kern_shape = theano.tensor.basic.cast(kern_shape, 'int64')
390391

391392
node = Apply(self, [kern_shape],
392393
[CDataType("cudnnConvolutionDescriptor_t",

theano/gpuarray/tests/test_dnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def _test_conv_gradw(self, img, topgrad, kerns, img_shape, kerns_shape, border_m
657657
)
658658

659659
kerns_vals = np.zeros(kerns_shape, dtype=theano.config.floatX)
660-
kerns_shape = theano.shared(np.asarray(kerns_shape, dtype=np.int64))
660+
kerns_shape = theano.shared(np.asarray(kerns_shape))
661661
desc = dnn.GpuDnnConvDesc(
662662
border_mode=border_mode,
663663
subsample=subsample,

0 commit comments

Comments
 (0)