提交 e11e41a6 编写于 作者: Z zhiqiu

fix NumpyArrayInitializer

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