Loading TOC...

ort.map

ort.map(
   $key as ort.value,
   $value as ort.value
) as ort.value

Summary

Creates a value with type "MAP", using an ort.value as key and an ort.value as value. Key and Value can be one dimensional tensor of the same length. Supported tensor element types are:

key element type value element type
STRING STRING
STRING INT64
STRING FLOAT
STRING DOUBLE
INT64 STRING
INT64 INT64
INT64 FLOAT
INT64 DOUBLE

Parameters
$key An ort.value, with value type "TENSOR", and element type either "STRING" or "INT64".
$value An ort.value, with value type "TENSOR", and element type either "STRING", "INT64", "FLOAT", or "DOUBLE".

Example

  ort.map(ort.string(["key1", "key2"],[2]),ort.value([1,2],[2],"float"))
  =>
  OrtMap([Key: OrtValue(Shape:[2], Type: STRING), Value: OrtValue(Shape:[2], Type: FLOAT)])

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