CreateSparseTensorWithValuesAsOrtValue property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtMemoryInfo> info, Pointer<Void> p_data, Pointer<Int64> dense_shape, Size dense_shape_len, Pointer<Int64> values_shape, Size values_shape_len, UnsignedInt type, Pointer<Pointer<OrtValue>> out)>> CreateSparseTensorWithValuesAsOrtValue
getter/setter pair

Create an ::OrtValue with a sparse tensor. This is the first step. Next, use Use

\paramin info memory info where sparse values reside. \paramin,out p_data pointer to a user allocated buffer with values. To create a full sparse tensor with no non-zero values, pass nullptr \paramin dense_shape shape of the original dense tensor \paramin dense_shape_len number of shape dimensions being passed \paramin values_shape shape of the values data. To create a fully sparse tensor with no non-zero values, pass {0} shape. \paramin values_shape_len number of values shape dimensions \paramin type must be one of TENSOR_ELEMENT_DATA_TYPE_xxxx \paramout out Should be freed by calling ReleaseValue

\snippet{doc} snippets.dox OrtStatus Return Value

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtMemoryInfo> info,
      ffi.Pointer<ffi.Void> p_data,
      ffi.Pointer<ffi.Int64> dense_shape,
      ffi.Size dense_shape_len,
      ffi.Pointer<ffi.Int64> values_shape,
      ffi.Size values_shape_len,
      ffi.UnsignedInt type,
      ffi.Pointer<ffi.Pointer<OrtValue>> out,
    )
  >
>
CreateSparseTensorWithValuesAsOrtValue;