UseCooIndices property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtValue> ort_value, Pointer<Int64> indices_data, Size indices_num)>> UseCooIndices
getter/setter pair

This assigns Coo format indices to the SparseTensor that was created by OrtApi::CreateSparseTensorWithValuesAsOrtValue above. It also sets OrtSparseFormat to ORT_SPARSE_COO. This will not allocate any additional memory for data. The life span of indices_data buffer should eclipse the life span of this ::OrtValue.

\paramin,out ort_value ::OrtValue instance constructed with OrtApi::CreateSparseTensorWithValuesAsOrtValue \paramin,out indices_data pointer to a user pre-allocated buffer or nullptr for fully sparse tensors. \paramin indices_num number of COO indices. Should either be 0 for fully sparse tensors, be equal to the number of nnz values specified to OrtApi::CreateSparseTensorWithValuesAsOrtValue for 1-D {nnz} indices or be twice as number of nnz values for a 2-D indices {nnz, 2}

\snippet{doc} snippets.dox OrtStatus Return Value

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtValue> ort_value,
      ffi.Pointer<ffi.Int64> indices_data,
      ffi.Size indices_num,
    )
  >
>
UseCooIndices;