提交 e11e41a6 编写于 作者: Z zhiqiu

fix NumpyArrayInitializer

上级 00b4073c
......@@ -875,18 +875,17 @@ class NumpyArrayInitializer(Initializer):
self._value = value
def __call__(self, var, block=None):
"""Add constant initialization ops for a variable
"""Initialize the input tensor with Numpy array.
Args:
var: Variable that needs to be initialized
block: The block in which initialization ops
should be added
var(Tensor): Tensor that needs to be initialized.
block(Block, optional): The block in which initialization ops
should be added. Used in static graph only, default None.
Returns:
the initialization op
The initialization op
"""
if block is None:
block = default_main_program().global_block()
block = self._check_block(block)
assert isinstance(var, framework.Variable)
assert isinstance(block, framework.Block)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册