|
|
|
@ -234,7 +234,7 @@ def sums(input, out=None):
|
|
|
|
|
return out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def assign(input, output):
|
|
|
|
|
def assign(input, output=None):
|
|
|
|
|
"""
|
|
|
|
|
**Assign**
|
|
|
|
|
|
|
|
|
@ -242,7 +242,7 @@ def assign(input, output):
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
input(Variable|numpy.ndarray): The source variable
|
|
|
|
|
output(Variable): The destination variable
|
|
|
|
|
output(Variable|None): The destination variable
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
Variable: The destination variable that was supplied as the *output*.
|
|
|
|
@ -255,6 +255,8 @@ def assign(input, output):
|
|
|
|
|
fluid.layers.assign(hidden, out)
|
|
|
|
|
"""
|
|
|
|
|
helper = LayerHelper('assign', **locals())
|
|
|
|
|
if output is None:
|
|
|
|
|
output = helper.create_tmp_variable(dtype=input.dtype)
|
|
|
|
|
if isinstance(input, Variable):
|
|
|
|
|
helper.append_op(
|
|
|
|
|
type='assign', inputs={'X': [input]}, outputs={'Out': [output]})
|
|
|
|
|