getIntList method

  1. @override
List<int> getIntList()
override

Returns an int array of the values stored in this buffer. If the buffer is of different type than int, the values will be converted into int, and loss of precision may apply. For example, getting an int array from a TensorBufferFloat with values {400.32, 23.04}, the output is {400, 23}.

Implementation

@override
List<int> getIntList() {
  List<int> arr = List.filled(flatSize, 0);
  for (int i = 0; i < flatSize; i++) {
    arr[i] = byteData.getUint8(i);
  }
  return arr;
}