Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion python/tflite_micro/shared_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ limitations under the License.
#ifndef TENSORFLOW_LITE_MICRO_TOOLS_PYTHON_INTERPRETER_SHARED_LIBRARY_H_
#define TENSORFLOW_LITE_MICRO_TOOLS_PYTHON_INTERPRETER_SHARED_LIBRARY_H_

#if defined(_WIN32)
#include <windows.h>
#else
#include <dlfcn.h>
#endif // defined(_WIN32)

namespace tflite {

Expand All @@ -30,9 +34,19 @@ namespace tflite {
class SharedLibrary {
public:
static inline void* GetSymbol(const char* symbol) {
#if defined(_WIN32)
return reinterpret_cast<void*>(GetProcAddress(GetModuleHandle(NULL), symbol));
#else
return dlsym(RTLD_DEFAULT, symbol);
#endif // defined(_WIN32)
}
static inline const char* GetError() {
#if defined(_WIN32)
return "Unknown error";
#else
return dlerror();
#endif // defined(_WIN32)
}
static inline const char* GetError() { return dlerror(); }
};

} // namespace tflite
Expand Down
18 changes: 9 additions & 9 deletions signal/micro/kernels/irfft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ void* IrfftInitAll(TfLiteContext* context, const char* buffer, size_t length) {

switch (tensor_type) {
case TensorType_INT16: {
return IrfftInit<int16_t, tflm_signal::IrfftInt16GetNeededMemory,
tflm_signal::IrfftInt16Init>(context, buffer, length);
return IrfftInit<int16_t, ::tflite::tflm_signal::IrfftInt16GetNeededMemory,
::tflite::tflm_signal::IrfftInt16Init>(context, buffer, length);
}
case TensorType_INT32: {
return IrfftInit<int32_t, tflm_signal::IrfftInt32GetNeededMemory,
tflm_signal::IrfftInt32Init>(context, buffer, length);
return IrfftInit<int32_t, ::tflite::tflm_signal::IrfftInt32GetNeededMemory,
::tflite::tflm_signal::IrfftInt32Init>(context, buffer, length);
}
case TensorType_FLOAT32: {
return IrfftInit<float, tflm_signal::IrfftFloatGetNeededMemory,
tflm_signal::IrfftFloatInit>(context, buffer, length);
return IrfftInit<float, ::tflite::tflm_signal::IrfftFloatGetNeededMemory,
::tflite::tflm_signal::IrfftFloatInit>(context, buffer, length);
}
default:
return nullptr;
Expand Down Expand Up @@ -181,13 +181,13 @@ TfLiteStatus IrfftEvalAll(TfLiteContext* context, TfLiteNode* node) {

switch (params->fft_type) {
case kTfLiteInt16: {
return IrfftEval<int16_t, tflm_signal::IrfftInt16Apply>(context, node);
return IrfftEval<int16_t, ::tflite::tflm_signal::IrfftInt16Apply>(context, node);
}
case kTfLiteInt32: {
return IrfftEval<int32_t, tflm_signal::IrfftInt32Apply>(context, node);
return IrfftEval<int32_t, ::tflite::tflm_signal::IrfftInt32Apply>(context, node);
}
case kTfLiteFloat32: {
return IrfftEval<float, tflm_signal::IrfftFloatApply>(context, node);
return IrfftEval<float, ::tflite::tflm_signal::IrfftFloatApply>(context, node);
}
default:
return kTfLiteError;
Expand Down
4 changes: 2 additions & 2 deletions signal/micro/kernels/overlap_add.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ TfLiteStatus OverlapAddEval(TfLiteContext* context, TfLiteNode* node) {
int input_index = (i * params->n_frames + frame) * params->frame_size;
int output_index = (i * params->n_frames + frame) * params->frame_step;
::tflm_signal::OverlapAdd(&input_data[input_index], buffer,
params->frame_size, &output_data[output_index],
params->frame_step);
params->frame_size, &output_data[output_index],
params->frame_step);
}
}
return kTfLiteOk;
Expand Down
4 changes: 4 additions & 0 deletions tensorflow/lite/micro/compression/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ sh_test(
"metadata_saved.h",
":metadata_cc_srcs",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)

tflm_cc_test(
Expand Down
Loading