resizeInputTensor method

void resizeInputTensor(
  1. int index,
  2. List<int> shape
)

Implementation

void resizeInputTensor(int index, List<int> shape) {
  final int dimsSize = shape.length;
  final Pointer<Int32> dims = calloc<Int32>(dimsSize);
  final Int32List externalTypedData = dims.asTypedList(dimsSize);
  externalTypedData.setRange(0, dimsSize, shape);
  try {
    checkState(TfLiteInterpreterResizeInputTensor(_ref, index, dims, dimsSize) == TfLiteStatus.kTfLiteOk);
  } finally {
    calloc.free(dims);
  }
  _allocated = false;
}