Loading TOC...

ort.value

ort.value(
   $data as Array,
   $index as integer,
   $type as String
) as ort.value

Summary

Constructs an ort.value to be supplied to an ort.session to perform inference. This function only creates ort.value with value type "TENSOR", and with a numeric element type. Use function ort.sequence to create ort.value with value type "SEQUENCE", and function ort.map to create ort.value with value type "MAP"; Use function ort.string to create tensor with element type "STRING".

Parameters
$data A numeric array represeting the fattened one-dimensional view of the data.
$index An array of integer representing the shape of the data.
$type A String representing the tensor element type of the data. Possible values include: FLOAT, UINT8, INT8, UINT16, INT16, INT32, INT64, DOUBLE, UINT32, UINT64. Notice not all element types returned by ort:sessionInputType and ort:sessionOutputType are supported.

Example

  ort.value([1,2,3,4,5,6], [2,3], "float")
  =>
  an ort.value, described as OrtValue(Shape:[2, 3], Type: FLOAT)

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