collectOutputTensorInfo function
- @Deprecated('Unused by this package. Use collectOutputShapes from flutter_litert. Will ' 'be removed in the next major release.')
- Interpreter itp
Collects output tensor shapes (and their backing buffers) for an interpreter.
Implementation
@Deprecated(
'Unused by this package. Use collectOutputShapes from flutter_litert. Will '
'be removed in the next major release.',
)
Map<int, OutputTensorInfo> collectOutputTensorInfo(Interpreter itp) {
final Map<int, OutputTensorInfo> outputs = <int, OutputTensorInfo>{};
for (int i = 0;; i++) {
try {
final Tensor t = itp.getOutputTensor(i);
outputs[i] = OutputTensorInfo(t.shape, t.data.buffer.asFloat32List());
} catch (_) {
break;
}
}
return outputs;
}