Loading TOC...


   $session as ort:session,
   $index as xs:unsignedLong
) as map:map


Returns a map:map containing the type information of an output of a session, specified by an index. The returned map:map is described in the following table:

Key Name Value Type Possible Values Details
value-type xs:string UNKNOWN, TENSOR, SEQUENCE, MAP, OPAQUE, SPARSETENSOR value-type describes the type of value expected by this output.
tensor-type xs:string UNDEFINED, FLOAT, UINT8, INT8, UINT16, INT16, INT32, INT64, STRING, BOOL, FLOAT16, DOUBLE, UINT32, UINT64, COMPLEX64, COMPLEX128, BFLOAT16 tensor-type describes the element type of the tensor. Only exists when value-type is TENSOR.
shape xs:long* A sequence of xs:long shape describes the shape of the tensor. Negative value means unknown. Only exists when value-type is TENSOR.

$session An ort:session.
$index The index of the input. Starts from 0.


  let $session := ort:session(fn:doc("testmodel.onnx"))
  return ort:session-output-type($session, 0)
  <map:map xmlns:map="http://marklogic.com/xdmp/map"
xmlns:xs="http://www.w3.org/2001/XMLSchema"> <map:entry key="tensor-type">
  <map:value xsi:type="xs:string">FLOAT
  <map:entry key="value-type">
  <map:value xsi:type="xs:string">TENSOR
  <map:entry key="shape">
  <map:value xsi:type="xs:long">1
  <map:value xsi:type="xs:long">1000
  <map:value xsi:type="xs:long">1
  <map:value xsi:type="xs:long">1

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