#[unsafe(no_mangle)]pub unsafe extern "C" fn tfe_tensor_f64_shape(
_tensor: *const TfeTensorF64,
_out_shape: *mut usize,
)Expand description
Write the shape of the tensor into the caller-provided buffer.
The caller must allocate out_shape with at least
tfe_tensor_f64_ndim(tensor) elements.
§Safety
tensormust be a valid, non-null tensor pointer.out_shapemust point to a buffer with at leastndimusizeslots.
§Examples (C)
size_t ndim = tfe_tensor_f64_ndim(t);
size_t *shape = malloc(ndim * sizeof(size_t));
tfe_tensor_f64_shape(t, shape);
// shape now contains the dimensions
free(shape);