#include "tensorflow/lite/profiling/profile_summarizer.h"
#include <memory>
#include <sstream>
#include <string>
#include "tensorflow/core/util/stats_calculator.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/core/api/profiler.h"
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/profiling/memory_info.h"
#include "tensorflow/lite/profiling/profile_buffer.h"
#include "tensorflow/lite/profiling/profile_summary_formatter.h"
namespace tflite {
namespace profiling {
namespace {
struct OperatorDetails { … };
std::string GetTensorName(const tflite::Interpreter& interpreter,
int tensor_index) { … }
std::vector<std::string> GetTensorNames(const tflite::Interpreter& interpreter,
const TfLiteIntArray* tensor_indices) { … }
std::string ToString(const std::vector<std::string>& str_vector) { … }
OperatorDetails GetOperatorDetails(const tflite::Interpreter& interpreter,
uint32_t subgraph_index,
uint32_t node_index) { … }
}
ProfileSummarizer::ProfileSummarizer(
std::shared_ptr<ProfileSummaryFormatter> summary_formatter)
: … { … }
void ProfileSummarizer::ProcessProfiles(
const std::vector<const ProfileEvent*>& profile_stats,
const tflite::Interpreter& interpreter) { … }
tensorflow::StatsCalculator* ProfileSummarizer::GetStatsCalculator(
uint32_t subgraph_index) { … }
}
}