Skip to content

Commit

Permalink
Revert FakeMicroContext changes for alternate profiler.
Browse files Browse the repository at this point in the history
Add default alternate profiler implementation to MicroContext.
  • Loading branch information
ddavis-2015 committed Nov 18, 2024
1 parent fddf003 commit 2f8cead
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
9 changes: 0 additions & 9 deletions tensorflow/lite/micro/fake_micro_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,4 @@ const CompressionTensorData* FakeMicroContext::GetTensorCompressionData(

#endif // USE_TFLM_COMPRESSION

TfLiteStatus FakeMicroContext::SetAlternateProfiler(
MicroProfilerInterface* alt_profiler) {
return kTfLiteError;
}

MicroProfilerInterface* FakeMicroContext::GetAlternateProfiler() const {
return nullptr;
}

} // namespace tflite
15 changes: 0 additions & 15 deletions tensorflow/lite/micro/fake_micro_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,6 @@ class FakeMicroContext : public MicroContext {

#endif // USE_TFLM_COMPRESSION

// Set the alternate MicroProfilerInterface.
// This can be used to profile subsystems simultaneously with the profiling
// of kernels during the Eval phase. See (b/379584353).
// The alternate MicroProfilerInterface is currently used by the tensor
// decompression subsystem.
TfLiteStatus SetAlternateProfiler(
MicroProfilerInterface* alt_profiler) override;

// Get the alternate MicroProfilerInterface.
// This can be used to profile subsystems simultaneously with the profiling
// of kernels during the Eval phase. See (b/379584353).
// The alternate MicroProfilerInterface is currently used by the tensor
// decompression subsystem.
MicroProfilerInterface* GetAlternateProfiler() const override;

private:
static constexpr int kNumScratchBuffers_ = 12;

Expand Down
8 changes: 6 additions & 2 deletions tensorflow/lite/micro/micro_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,18 @@ class MicroContext {
// The alternate MicroProfilerInterface is currently used by the tensor
// decompression subsystem.
virtual TfLiteStatus SetAlternateProfiler(
MicroProfilerInterface* alt_profiler) = 0;
MicroProfilerInterface* alt_profiler) {
return kTfLiteError;
}

// Get the alternate MicroProfilerInterface.
// This can be used to profile subsystems simultaneously with the profiling
// of kernels during the Eval phase. See (b/379584353).
// The alternate MicroProfilerInterface is currently used by the tensor
// decompression subsystem.
virtual MicroProfilerInterface* GetAlternateProfiler() const = 0;
virtual MicroProfilerInterface* GetAlternateProfiler() const {
return nullptr;
}

private:
TF_LITE_REMOVE_VIRTUAL_DELETE
Expand Down

0 comments on commit 2f8cead

Please sign in to comment.