FillSparseTensorBlockSparse property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtValue> ort_value, Pointer<OrtMemoryInfo> data_mem_info, Pointer<Int64> values_shape, Size values_shape_len, Pointer<Void> values, Pointer<Int64> indices_shape_data, Size indices_shape_len, Pointer<Int32> indices_data)>> FillSparseTensorBlockSparse
getter/setter pair

This fills populates an empty tensor that was created using OrtApi::CreateSparseTensorAsOrtValue. This will allocate required memory and copy the supplied NNZ values and BlockSparse indices into that memory allocation. Memory allocation is performed using the allocator that was specified with OrtApi::CreateSparseTensorAsOrtValue.

\paramin,out ort_value ::OrtValue to populate with data \paramin data_mem_info serves to identify the location of the data to be copied. If the allocator specified at the creation time has memory info that is not the same as mem_info argument to this function a X-device copy will be performed. String data is assumed to be on CPU and will only be copied into a CPU allocated buffer. \paramin values_shape \paramin values_shape_len \paramin values structure with values information \paramin indices_shape_data pointer to a location of indices shape \paramin indices_shape_len length of the block sparse indices shape \paramin indices_data pointer to a location of indices data. Shape will determine the length of the indices data.

\snippet{doc} snippets.dox OrtStatus Return Value

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtValue> ort_value,
      ffi.Pointer<OrtMemoryInfo> data_mem_info,
      ffi.Pointer<ffi.Int64> values_shape,
      ffi.Size values_shape_len,
      ffi.Pointer<ffi.Void> values,
      ffi.Pointer<ffi.Int64> indices_shape_data,
      ffi.Size indices_shape_len,
      ffi.Pointer<ffi.Int32> indices_data,
    )
  >
>
FillSparseTensorBlockSparse;