[−][src]Function xaynet::sdk::api::get_model
#[no_mangle]pub unsafe extern "C" fn get_model(
client: *mut FFIClient,
dtype: c_uint
) -> PrimitiveModel
Gets a mutable slice PrimitiveModel
to the latest global model converted to the primitive
data type dtype
.
The global model gets cached, which overwrites any existing cached model. The cache and slice are valid as described in step 4 of the workflow. The cached model can be modified in place, for example for training.
The following data types dtype
are currently supported:
Errors
Ignores null pointer client
s and invalid dtype
s and returns a PrimitiveModel
with null
pointer, length zero and void data type immediately.
Returns a PrimitiveModel
with null pointer, length zero and data type dtype
if no global
model is available.
Returns a PrimitiveModel
with null pointer, length of the global model and data type dtype
if the conversion of the global model into the primitive data type fails.
Safety
The method dereferences from the raw pointer arguments. Therefore, the behavior of the method is undefined if the arguments don't point to valid objects.