提交 165ac99b authored 作者: Frederic's avatar Frederic

correctly raise an error for mode not suported by neibs2images

上级 420680d3
...@@ -306,8 +306,12 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'): ...@@ -306,8 +306,12 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'):
pad_shape = list(output_4d.shape) pad_shape = list(output_4d.shape)
pad_shape[d] = original_shape[d] - valid_shape[d] pad_shape[d] = original_shape[d] - valid_shape[d]
output_4d = T.concatenate([output_4d, T.zeros(pad_shape)], axis=d) output_4d = T.concatenate([output_4d, T.zeros(pad_shape)], axis=d)
else: elif mode == 'valid':
# TODO: we do not implement all mode with this code.
# Add a check for the good cases.
output_4d = output_2d.reshape(original_shape) output_4d = output_2d.reshape(original_shape)
else:
raise NotImplementedError("neibs2images do not support mode=%s" % mode)
return output_4d return output_4d
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论