提交 f278742c authored 作者: Frederic's avatar Frederic

Added an assert in an example to show people how to test that.

上级 d861fd61
...@@ -45,6 +45,7 @@ you should check the strides and alignment. ...@@ -45,6 +45,7 @@ you should check the strides and alignment.
def make_node(self, x): def make_node(self, x):
x_ = tensor.as_tensor_variable(x) x_ = tensor.as_tensor_variable(x)
assert x_.ndim == 1
return theano.Apply(self, return theano.Apply(self,
inputs=[x_], inputs=[x_],
outputs=[x_.type()]) outputs=[x_.type()])
......
...@@ -899,7 +899,8 @@ class T_fibby(unittest.TestCase): ...@@ -899,7 +899,8 @@ class T_fibby(unittest.TestCase):
return hash(type(self)) return hash(type(self))
def make_node(self, x): def make_node(self, x):
x_ = tensor.as_tensor_variable(x) x_ = theano.tensor.as_tensor_variable(x)
assert x_.ndim == 1
return theano.Apply(self, return theano.Apply(self,
inputs=[x_], inputs=[x_],
outputs=[x_.type()]) outputs=[x_.type()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论