message: Move explicit template instantiations to namespace scope.
  Fixes compile error on mac os on attached bug causing 1.13
  build problems.
diff: @@ -79,32 +79,7 @@ class TfLiteDriver::Expectation {
  SetTensorData(values, &data_);
  }
  - template <>
  - void SetData<string>(const string& csv_values) {
  - string s = absl::HexStringToBytes(csv_values);
  - data_.raw = new char[s.size()];
  - memcpy(data_.raw, s.data(), s.size());
  - }
  -
  - bool Check(bool verbose, const TfLiteTensor& tensor) {
  - switch (tensor.type) {
  - case kTfLiteFloat32:
  - return TypedCheck<float>(verbose, tensor);
  - case kTfLiteInt32:
  - return TypedCheck<int32_t>(verbose, tensor);
  - case kTfLiteInt64:
  - return TypedCheck<int64_t>(verbose, tensor);
  - case kTfLiteUInt8:
  - return TypedCheck<uint8_t>(verbose, tensor);
  - case kTfLiteBool:
  - return TypedCheck<bool>(verbose, tensor);
  - case kTfLiteString:
  - return TypedCheck<string>(verbose, tensor);
  - default:
  - fprintf(stderr, "Unsupported type %d in Check\n", tensor.type);
  - return false;
  - }
  - }
  + bool Check(bool verbose, const TfLiteTensor& tensor);
  private:
  template <typename T>
  @@ -146,8 +121,20 @@ class TfLiteDriver::Expectation {
  return good_output;
  }
  + TfLitePtrUnion data_;
  + size_t num_elements_;
  +};
  +
  template <>
  - bool TypedCheck<string>(bool verbose, const TfLiteTensor& tensor) {
  +void TfLiteDriver::Expectation::SetData<string>(const string& csv_values) {
  + string s = absl::HexStringToBytes(csv_values);
  + data_.raw = new char[s.size()];
  + memcpy(data_.raw, s.data(), s.size());
  +}
  +
  +template <>
  +bool TfLiteDriver::Expectation::TypedCheck<string>(bool verbose,
  + const TfLiteTensor& tensor) {
  if (tensor.data.raw == nullptr) {
  if (verbose) {
  std::cerr << " got empty string" << std::endl;
  @@ -176,8 +163,7 @@ class TfLiteDriver::Expectation {
  }
  if (strncmp(expected_ref.str, returned_ref.str, returned_ref.len) != 0) {
  if (verbose) {
  - std::cerr << " index " << i << ": strings are different"
  - << std::endl;
  + std::cerr << " index " << i << ": strings are different" << std::endl;
  }
  return false;
  }
  @@ -186,9 +172,26 @@ class TfLiteDriver::Expectation {
  return true;
  }
  - TfLitePtrUnion data_;
  - size_t num_elements_;
  -};
  +bool TfLiteDriver::Expectation::Check(bool verbose,
  + const TfLiteTensor& tensor) {
  + switch (tensor.type) {
  + case kTfLiteFloat32:
  + return TypedCheck<float>(verbose, tensor);
  + case kTfLiteInt32:
  + return TypedCheck<int32_t>(verbose, tensor);
  + case kTfLiteInt64:
  + return TypedCheck<int64_t>(verbose, tensor);
  + case kTfLiteUInt8:
  + return TypedCheck<uint8_t>(verbose, tensor);
  + case kTfLiteBool:
  + return TypedCheck<bool>(verbose, tensor);
  + case kTfLiteString:
  + return TypedCheck<string>(verbose, tensor);
  + default:
  + fprintf(stderr, "Unsupported type %d in Check\n", tensor.type);
  + return false;
  + }
  +}
  TfLiteDriver::TfLiteDriver(bool use_nnapi, const string& delegate_name,
  bool reference_kernel)
  