message: Fix for scalar tensors with BytesRequiredForTensor.
diff: @@ -83,9 +83,13 @@ TfLiteStatus BytesRequiredForTensor(const tflite::Tensor& flatbuffer_tensor,
  size_t* bytes, size_t* type_size,
  ErrorReporter* error_reporter) {
  int element_count = 1;
  + // If flatbuffer_tensor.shape == nullptr, then flatbuffer_tensor is a scalar
  + // so has 1 element.
  + if (flatbuffer_tensor.shape() != nullptr) {
  for (size_t n = 0; n < flatbuffer_tensor.shape()->Length(); ++n) {
  element_count *= flatbuffer_tensor.shape()->Get(n);
  }
  + }
  TfLiteType tf_lite_type;
  TF_LITE_ENSURE_STATUS(ConvertTensorType(flatbuffer_tensor.type(),
  