提交 b04be2a9 authored 作者: Frederic Bastien's avatar Frederic Bastien

Also do the check in python

上级 b09d1118
...@@ -177,6 +177,12 @@ class Images2Neibs(Op): ...@@ -177,6 +177,12 @@ class Images2Neibs(Op):
c, d = neib_shape c, d = neib_shape
step_x, step_y = neib_step step_x, step_y = neib_step
mode = self.mode mode = self.mode
if step_x <= 0 or step_y <= 0:
raise ValueError(
"neib_step wrong step ; values <= 0. Got " + str(neib_step))
if c <= 0 or d <= 0:
raise ValueError(
"neib_shape values <=0. Got " + str(neib_shape))
if mode == "wrap_centered": if mode == "wrap_centered":
if (c % 2 != 1) or (d % 2 != 1): if (c % 2 != 1) or (d % 2 != 1):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论