提交 99b29f61 authored 作者: Frederic's avatar Frederic

Make Rebroadcast check that the axis he receive are integers.

上级 edbab4ef
...@@ -4655,6 +4655,9 @@ class Rebroadcast(Op): ...@@ -4655,6 +4655,9 @@ class Rebroadcast(Op):
def __init__(self, *axis): def __init__(self, *axis):
self.axis = dict(axis) self.axis = dict(axis)
for axis, broad in self.axis.iteritems():
assert isinstance(axis, (numpy.integer, int)), (
"Rebroadcast need integers axis. Got ", axis)
def __eq__(self, other): def __eq__(self, other):
return type(self) == type(other) and self.axis == other.axis return type(self) == type(other) and self.axis == other.axis
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论