#include "tensorflow/lite/core/tools/verifier.h"
#include <algorithm>
#include <climits>
#include <complex>
#include <cstdint>
#include <cstring>
#include "absl/container/flat_hash_set.h"
#include "absl/types/optional.h"
#include "flatbuffers/string.h"
#include "tensorflow/compiler/mlir/lite/schema/schema_utils.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/core/api/error_reporter.h"
#include "tensorflow/lite/core/api/op_resolver.h"
#include "tensorflow/lite/core/tools/verifier_internal.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/util.h"
#include "tensorflow/lite/version.h"
namespace tflite {
namespace {
const char* NameOrEmptyString(const flatbuffers::String* str) { … }
bool IsNullOrEmptyString(const flatbuffers::String* str) { … }
void ReportError(ErrorReporter* error_reporter, const char* format, ...) { … }
const uint32_t GetIntPtr(const char* ptr) { … }
const uint32_t kMaxNumString = …;
bool VerifyStringTensorBuffer(const Tensor& tensor, const Buffer& buffer,
ErrorReporter* error_reporter) { … }
bool CheckArraySegments(const DimensionMetadata* dim_metadata) { … }
int GetSizeOfSegments(const DimensionMetadata* dim_metadata) { … }
int GetValueOfSegmentsAt(const DimensionMetadata* dim_metadata, const int i) { … }
bool CheckArrayIndices(const DimensionMetadata* dim_metadata) { … }
int GetSizeOfIndices(const DimensionMetadata* dim_metadata) { … }
int GetValueOfIndicesAt(const DimensionMetadata* dim_metadata, const int i) { … }
absl::optional<uint64_t> VerifyAndCountElements(
const SparsityParameters& sparsity, const std::vector<int>& dim_sizes) { … }
absl::optional<uint64_t> VerifyAndCountSparseElements(const Tensor& tensor) { … }
bool VerifyNumericTensorBuffer(const Tensor& tensor, const Buffer& buffer,
ErrorReporter* error_reporter) { … }
Offset;
Vector;
bool VerifyOperators(const Vector<Offset<Operator>>& operators,
ErrorReporter* error_reporter) { … }
bool IsConstantTensor(const Tensor& tensor, const Model& model) { … }
bool VerifySubGraphConsistency(const Model& model, const SubGraph& subgraph,
ErrorReporter* error_reporter) { … }
bool VerifySubGraphs(const Model& model, ErrorReporter* error_reporter) { … }
bool VerifyTensors(const Model& model, ErrorReporter* error_reporter) { … }
bool VerifyOps(const Model& model, const OpResolver& resolver,
ErrorReporter* error_reporter) { … }
bool VerifyModel(const Model* model, ErrorReporter* error_reporter) { … }
}
bool Verify(const void* buf, size_t len, ErrorReporter* error_reporter) { … }
bool Verify(const void* buf, size_t len, const OpResolver& resolver,
ErrorReporter* error_reporter) { … }
}