activationDataTypeWireValue function

int? activationDataTypeWireValue(
  1. ActivationDataType? type
)

The C API's number for type (ActivationDataType in LiteRT-LM's executor_settings_base.h: 0 F32, 1 F16, and 2 I16 / 3 I8 which the Dart enum does not offer), or null to leave the engine setting untouched. Spelled out rather than taken from index, so reordering the Dart enum cannot silently change what native receives.

Implementation

int? activationDataTypeWireValue(ActivationDataType? type) => switch (type) {
  null => null,
  ActivationDataType.float32 => 0,
  ActivationDataType.float16 => 1,
};