Loading TOC...

ort.sessionOutputType

ort.sessionOutputType(
   $session as ort.session,
   $index as integer
) as object

Summary

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

Key Name Value Type Possible Values Details
valueType String UNKNOWN, TENSOR, SEQUENCE, MAP, OPAQUE, SPARSETENSOR valueType describes the type of value expected by this output.
tensorType String UNDEFINED, FLOAT, UINT8, INT8, UINT16, INT16, INT32, INT64, STRING, BOOL, FLOAT16, DOUBLE, UINT32, UINT64, COMPLEX64, COMPLEX128, BFLOAT16 tensorType describes the element type of the tensor. Only exists when valueType is TENSOR.
shape Array An array of integer shape describes the shape of the tensor. Negative value means unknown. Only exists when valueType is TENSOR.

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

Example

  const session = ort.session(cts.doc("testmodel.onnx"));
  ort.sessionOutputType(session, 0)
  =>
  {
  "shape": [
  1,
  1000,
  1,
  1
  ]
  ,
  "tensorType": "FLOAT",
  "valueType": "TENSOR"
}

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