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

added an assert in ConvOp.make_node to generate an error earlier.

上级 c4aa7a6e
......@@ -88,7 +88,12 @@ class ConvOp(Op):
def make_node(self, inputs, kerns):
# TODO: find a way to make ConvOp work for N-D (after NIPS09)
outdim = kerns.ndim
output = tensor.tensor(dtype=inputs.type.dtype, broadcastable=[False]*outdim);
print inputs.type.dtype, kerns.type.dtype
if inputs.type.dtype != kerns.type.dtype:
raise Exception("The image and the kernel must have the same type.")
output = tensor.tensor(dtype=inputs.type.dtype,
broadcastable=[False]*outdim,
name="ConvOp_Output");
return gof.Apply(self, [inputs, kerns], [output])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论