#[unsafe(no_mangle)]pub unsafe extern "C" fn tfe_tensor_f64_from_data(
_data: *const f64,
_len: usize,
_shape: *const usize,
_ndim: usize,
_status: *mut tfe_status_t,
) -> *mut TfeTensorF64Expand description
Create a tensor from caller-provided data (copy semantics).
The data is copied into Rust-owned storage. The caller retains
ownership of the data pointer and may free it after this call.
The internal memory layout (strides) is implementation-defined.
For zero-copy tensor exchange with specific memory layouts, use
tfe_tensor_f64_from_dlpack instead.
§Safety
datamust point to at leastlenvalidf64values.shapemust point to at leastndimvalidusizevalues.statusmust be a valid, non-null pointer.
§Examples (C)
double data[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
size_t shape[] = {2, 3};
tfe_status_t status;
tfe_tensor_f64 *t = tfe_tensor_f64_from_data(data, 6, shape, 2, &status);
assert(status == TFE_SUCCESS);
tfe_tensor_f64_release(t);