Loading TOC...

cntk:assign

cntk:assign(
   $ref as cntk:variable,
   $input as cntk:variable,
   [$name as xs:string]
) as cntk:function

Summary

Assign the value in operand to ref and return the new value, ref need to be the same layout as operand. During forward pass, ref will get the new value after the forward or backward pass finish, so that any part of the graph that depend on ref will get the old value. To get the new value, use the one returned by the assign node.The reason for that is to make ``assign`` have a deterministic behavior. During inference the value of ref wull be updated after the forward pass and during training the value of ref will be updated after backprop.

Parameters
$ref The variable that input value is assigned to.
$input The input assigned to ref.
$name The name of the function instance in the network.

Example

  let $shape := cntk:shape((3))
  let $input-variable := cntk:input-variable($shape, "float", fn:false(),
    fn:false(),"input1",())
  let $c := cntk:parameter-from-scalar($shape,"float", 0.1)
  return cntk:assign($c, $input-variable)
  => cntk:function(Composite Assign (Input(Name(input1), Shape([3]), Dynamic
  Axes([]))))

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.