提交 0b6c6670 authored 作者: Frederic Bastien's avatar Frederic Bastien

make a copy of the dict and modif the copy. Verif that the dict don't have the key we add.

上级 d04ced5e
...@@ -635,6 +635,10 @@ def gen_conv_code_unroll_batch_kern(d,unroll_bsize=1, unroll_ksize=1): ...@@ -635,6 +635,10 @@ def gen_conv_code_unroll_batch_kern(d,unroll_bsize=1, unroll_ksize=1):
""" c_code for ConvOp that unroll the batch size loop """ c_code for ConvOp that unroll the batch size loop
""" """
assert unroll_bsize>0 and unroll_ksize>0 assert unroll_bsize>0 and unroll_ksize>0
if d.has_key("unroll_bsize") or d.has_key("unroll_ksize") or d.has_key("unroll_iter") or d.has_key("unroll_biter") or d.has_key("unroll_kiter"):
raise Exception("We can't use this dictionnary as we will overwrite some of its containt")
d=d.copy()
d["unroll_bsize"]=unroll_bsize d["unroll_bsize"]=unroll_bsize
d["unroll_ksize"]=unroll_ksize d["unroll_ksize"]=unroll_ksize
def my_dup(st,size): def my_dup(st,size):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论