Internal fix on converter.

PiperOrigin-RevId: 336958737
Change-Id: I4e1b5983b1330e2aaef1cdb0a4058bada8732cae
This commit is contained in:
Hyeonjong Ryu 2020-10-13 14:40:26 -07:00 committed by TensorFlower Gardener
parent c0b57b23be
commit 8572e0189a

View File

@ -225,7 +225,8 @@ PyObject* CalibrationWrapper::SetTensor(int index, PyObject* value) {
for (int j = 0; j < PyArray_NDIM(array); j++) {
// Ensure the calibration data input shape is the same as the model input
// shape unless the dimension is unknown.
if (tensor->dims_signature->size == tensor->dims->size &&
if (tensor->dims_signature != nullptr &&
tensor->dims_signature->size == tensor->dims->size &&
tensor->dims_signature->data[j] == -1) {
has_unknown_dims = true;
} else if (tensor->dims->data[j] != PyArray_SHAPE(array)[j]) {