Loading TOC...

cntk:sequence-scatter-with-factor

cntk:sequence-scatter-with-factor(
   $operand as cntk:variable,
   $condition as cntk:variable,
   $factor as json:array,
   $name as xs:string
) as cntk:function

Summary

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.

Parameters
$operand The operand of the operation.
$condition The symbolic sequence which denotes the locations where elements should be copied.
$factor
$name The name of the function instance in the network.

Example

xquery version "1.0-ml";
let $input-variable := cntk:input-variable(cntk:shape((1)), "float")
let $model := cntk:sequence-scatter-with-factor(cntk:sequence-last($input-variable), cntk:sequence-is-first($input-variable), json:to-array((2,-3)))
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.