Loading TOC...


   $seq as cntk:variable,
   $condition as cntk:variable,
   $name as xs:string
) as cntk:function


Performs the inverse of gather. The sequence ``seq`` must have as many elements as the number of True values in the sequence ``condition``. It will return a sequence whose length is the same as the ``condition`` sequence with zeroes everywhere except for the locations where ``condition`` evaluates to True in which case it will copy the elements from ``seq`` preserving their order.

$seq The symbolic sequence from which elements will be copied in the output.
$condition The symbolic sequence which denotes the locations where elements should be copied.
$name The name of the function instance in the network.


xquery version "1.0-ml";
let $input-variable := cntk:input-variable(cntk:shape((1)), "float")
let $model := cntk:sequence-scatter(cntk:sequence-last($input-variable), cntk:sequence-is-first($input-variable))
let $input-value := cntk:sequence(cntk:shape((1)), json:to-array(1 to 8), fn:true())
let $pair := json:to-array(($input-variable, $input-value))
let $output-variable := cntk:function-output($model)
let $output-value := cntk:evaluate($model, $pair, $output-variable)
return (cntk:value-to-array($output-variable, $output-value))

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