run method
Runs inference on the model with the given input tensor. Returns the output tensor as a Float32List.
Implementation
@override
Future<Float32List> run(Float32List input, List<int> shape) async {
final jsData = input.toJS;
final jsShape = JSArray<JSNumber>();
for (final s in shape) {
jsShape.add(s.toJS);
}
final inputTensor = _JsLiteRtTensor(jsData, jsShape);
final results = await _jsModel.run(inputTensor).toDart;
final outputTensor = results.toDart[0];
final wasmTensor = await outputTensor.moveTo('wasm'.toJS).toDart;
final array = wasmTensor.toTypedArray();
return array.toDart;
}