提交 7cbb30e1 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix borrow flag, after code review.

上级 4bbac540
...@@ -86,7 +86,7 @@ class RandomStreams(raw_random.RandomStreamsBase): ...@@ -86,7 +86,7 @@ class RandomStreams(raw_random.RandomStreamsBase):
simpler syntax ``item.rng.get_value()`` is also valid. simpler syntax ``item.rng.get_value()`` is also valid.
""" """
return item.get_value() return item.get_value(borrow=True)
def __setitem__(self, item, val): def __setitem__(self, item, val):
"""Set the numpy RandomState instance associated with a particular stream """Set the numpy RandomState instance associated with a particular stream
...@@ -102,7 +102,7 @@ class RandomStreams(raw_random.RandomStreamsBase): ...@@ -102,7 +102,7 @@ class RandomStreams(raw_random.RandomStreamsBase):
simpler syntax ``item.rng.set_value(val)`` is also valid. simpler syntax ``item.rng.set_value(val)`` is also valid.
""" """
item.set_value(val) item.set_value(val, borrow=True)
def gen(self, op, *args, **kwargs): def gen(self, op, *args, **kwargs):
"""Create a new random stream in this container. """Create a new random stream in this container.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论