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

added Assert.infer_shape and added a python assert in the optimization that generate Assert.

上级 8e34b4bb
......@@ -682,6 +682,9 @@ class Assert(T.Op):
def c_code_cache_version(self):
return (0,1)
def infer_shape(self, node, input_shapes):
return [input_shapes[0]]
assert_ = Assert()
@register_specialize
......@@ -771,6 +774,7 @@ def local_alloc_elemwise(node):
new.append(new_i)
else: new.append(i)
new[no_broad_idx]=assert_op
assert assert_op.owner.op is assert_
return [node.op(*new)]
#TODO, global optimizer that lift the assert to the beginning of the graph.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论