提交 e500a276 authored 作者: notoraptor's avatar notoraptor

Fix int64 casting directly in make_node() method.

上级 f0744c09
...@@ -385,8 +385,9 @@ class GpuDnnConvDesc(COp): ...@@ -385,8 +385,9 @@ class GpuDnnConvDesc(COp):
self.precision = precision self.precision = precision
def make_node(self, kern_shape): def make_node(self, kern_shape):
if kern_shape.type.ndim != 1 or kern_shape.type.dtype != 'int64': if kern_shape.type.ndim != 1 or kern_shape.dtype not in theano.tensor.basic.int_dtypes:
raise TypeError('kern must be an int64 1D shape tensor') raise TypeError('kern must be an int64 1D shape tensor')
kern_shape = theano.tensor.basic.cast(kern_shape, 'int64')
node = Apply(self, [kern_shape], node = Apply(self, [kern_shape],
[CDataType("cudnnConvolutionDescriptor_t", [CDataType("cudnnConvolutionDescriptor_t",
......
...@@ -657,7 +657,7 @@ class TestDnnInferShapes(utt.InferShapeTester): ...@@ -657,7 +657,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
) )
kerns_vals = np.zeros(kerns_shape, dtype=theano.config.floatX) kerns_vals = np.zeros(kerns_shape, dtype=theano.config.floatX)
kerns_shape = theano.shared(np.asarray(kerns_shape, dtype=np.int64)) kerns_shape = theano.shared(np.asarray(kerns_shape))
desc = dnn.GpuDnnConvDesc( desc = dnn.GpuDnnConvDesc(
border_mode=border_mode, border_mode=border_mode,
subsample=subsample, subsample=subsample,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论