提交 06645b5c authored 作者: James Bergstra's avatar James Bergstra

conv2d - corrected assertion to TypeError

上级 ab753562
...@@ -316,8 +316,14 @@ class ConvOp(Op): ...@@ -316,8 +316,14 @@ class ConvOp(Op):
:param kshp_logical_top_aligned: idem :param kshp_logical_top_aligned: idem
""" """
assert isinstance(dx,(int,None)),'ConvOp.__init__ param dx must be an int' if dx is not None:
assert isinstance(dy,(int,None)),'ConvOp.__init__ param dy must be an int' if int(dx) != dx:
raise TypeError('ConvOp.__init__ param dx must be an int', dx)
dx = int(dx)
if dy is not None:
if int(dy) != dy:
raise TypeError('ConvOp.__init__ param dy must be an int', dy)
dy = int(dy)
all_shape = imshp is not None and kshp is not None and \ all_shape = imshp is not None and kshp is not None and \
nkern is not None and bsize is not None nkern is not None and bsize is not None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论