Loading TOC...

cntk:element-select

cntk:element-select(
   $condition as cntk:variable,
   $then-operand as cntk:variable,
   $else-operand as cntk:variable,
   [$name as xs:string]
) as cntk:function

Summary

Return either value_if_true or value_if_false based on the value of flag. If flag != 0 value_if_true is returned, otherwise value_if_false. Behaves analogously to numpy.where(...).

Parameters
$condition Condition tensor.
$then-operand True branch tensor.
$else-operand False branch tensor.
$name The name of the function instance in the network.

Example

  let $input-variable1 := cntk:input-variable(cntk:shape((3)), "float",
    fn:false(), fn:false(), "feature")
  let $input-variable2 := cntk:input-variable(cntk:shape((3)), "float",
    fn:false(), fn:false(), "feature")
  return cntk:element-select($input-variable2, $input-variable2, $input-variable2, "LxY")
  => cntk:function(Composite Select (Input(Name(feature), Shape([3]),
  Dynamic Axes([Sequence Axis(Default Dynamic Axis), Batch Axis(Default Batch Axis)]))))

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