Loading TOC...

cntk:sequence

cntk:sequence(
   $shape as cntk:shape,
   $data as json:array,
   $sequence-start-flag as xs:boolean,
   [$device as cntk:device],
   [$data-type as xs:string],
   [$read-only as xs:boolean]
) as cntk:value

Summary

Constructs a CNTK sequence as a cntk:value type. A CNTK sequence is a special kind of cntk:value, with the outer most dimension being the "sequence dimension", which is dynamic, and represents the length (number of values) of this sequence. The length of $data must be a multiple of the size represented by $shape.

Parameters
$shape The shape of each value in the sequence.
$data A one dimensional sequence of numbers representing the flattened view of the sequence. The length must be a multiple of the size represented by $shape, otherwise an exception is thrown.
$sequence-start-flag "true" means this sequence is the start of a new sequence. "false" means this sequence is a continuation of the previous sequence.
$device The device on which the sequence resides.
$data-type The data type of this value. Can be "float" or "double". Default is "float".
$read-only Whether the sequence is read only. Right now, only false is supported.

Example

  cntk:sequence(cntk:shape((2,3)), json:to-array((1 to 12)), (fn:true(),fn:true()))
  => cntk:value(Shape([2 x 3 x 2 x 1]), Device Kind Name(GPU))
     cntk:value(Shape([2 x 3 x 2 x 1]), Device Kind Name(GPU))

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