提交 279ff3bb authored 作者: Mohammad Pezeshki's avatar Mohammad Pezeshki

Param.default to In.value

上级 ce2e15b3
......@@ -470,7 +470,7 @@ def _pfunc_param_to_in(param, strict=False, allow_downcast=None):
return In(
variable=param.variable,
name=param.name,
value=param.default,
value=param.value,
mutable=param.mutable,
strict=param.strict,
borrow=param.borrow,
......
......@@ -26,7 +26,7 @@ class Test_pfunc(unittest.TestCase):
a = lscalar()
b = shared(1)
f1 = pfunc([a], (a + b))
f2 = pfunc([In(a, default=44)], a + b, updates={b: b + 1})
f2 = pfunc([In(a, value=44)], a + b, updates={b: b + 1})
self.assertTrue(b.get_value() == 1)
self.assertTrue(f1(3) == 4)
self.assertTrue(f2(3) == 4)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论