#[unsafe(no_mangle)]pub unsafe extern "C" fn hurray_descriptor_shape(
handle: *const HurrayDescriptor,
out_dims: *mut u64,
out_rank: *mut usize,
) -> HurrayStatusExpand description
Reads the shape (dimension sizes) of a tensor descriptor.
This function uses a capacity/length in-out pattern:
- Set
*out_rankto the capacity of theout_dimsarray (number ofuint64_telements it can hold), or to0ifout_dimsis null. - On return,
*out_rankalways contains the true rank of the tensor. - If
out_dimsis null OR the capacity was less than the true rank, the function returnsHURRAY_ERR_BUFFER_TOO_SMALLand*out_rankcontains the true rank so the caller can allocate and retry. - Otherwise the function writes the dimension sizes into
out_dims[0..rank]and returnsHURRAY_OK.
§Safety
handleandout_rankMUST be valid, non-null pointers.- If
out_dimsis non-null it MUST be writable forcapacity× 8 bytes, wherecapacityis the value at*out_rankon entry.