Values of length smaller or equal to
{@link ANEURALNETWORKS_MAX_SIZE_OF_IMMEDIATELY_COPIED_VALUES}
are immediately copied into the model.
For values of length greater than {@link ANEURALNETWORKS_MAX_SIZE_OF_IMMEDIATELY_COPIED_VALUES},
a pointer to the buffer is stored within the model. The application is responsible
for not changing the content of this region until all executions using this model
have completed. As the data may be copied during processing, modifying the data
after this call yields undefined results.
For large tensors, using {@link ANeuralNetworksModel_setOperandValueFromMemory}
is likely to be more efficient.
To indicate that an optional operand should be considered missing,
pass nullptr for buffer and 0 for length.
Attempting to modify a model once {@link ANeuralNetworksModel_finish} has been
called will return an error.
See {@link ANeuralNetworksModel} for information on multithreaded usage.
Available since API level 27.
@param model The model to be modified.
@param index The index of the model operand we're setting.
@param buffer A pointer to the data to use.
@param length The size in bytes of the data value.
Sets an operand to a constant value.
Values of length smaller or equal to {@link ANEURALNETWORKS_MAX_SIZE_OF_IMMEDIATELY_COPIED_VALUES} are immediately copied into the model.
For values of length greater than {@link ANEURALNETWORKS_MAX_SIZE_OF_IMMEDIATELY_COPIED_VALUES}, a pointer to the buffer is stored within the model. The application is responsible for not changing the content of this region until all executions using this model have completed. As the data may be copied during processing, modifying the data after this call yields undefined results.
For large tensors, using {@link ANeuralNetworksModel_setOperandValueFromMemory} is likely to be more efficient.
To indicate that an optional operand should be considered missing, pass nullptr for buffer and 0 for length.
Attempting to modify a model once {@link ANeuralNetworksModel_finish} has been called will return an error.
See {@link ANeuralNetworksModel} for information on multithreaded usage.
Available since API level 27.
@param model The model to be modified. @param index The index of the model operand we're setting. @param buffer A pointer to the data to use. @param length The size in bytes of the data value.
@return ANEURALNETWORKS_NO_ERROR if successful.