tflite-support
tflite-support copied to clipboard
Added Utils for iOS Task Library Backed by C++ APIs
The problem with adding cpp functions into TFLCommonUtils.m
is that this will become an ObjC++ .mm
file. Any files that use TFLCommonUtils
will also have to become ObjC++ files for this reason. Say TFLImageClassifier.m
-> TFLImageClassifier.mm.
Is the dependency issue because of inheritance? If so we can keep the three independent, say TFLCommonUtils
, TFLCommonCppUtils
and TFLCommonCUtils
all inheriting from NSObject
. I added inheritance so that the classes that use TFLCommonUtils
don't have to import both dependencies, say Image Classifier can import TFLCommonCUtils
instead of importing both TFLCommonUtills
and TFLCommonCUtils
. But this is not necessary, if it is causing an issue at your end.
In that way files that use the C library don't need to be ObjC++ files.
Acked the issue with turning the TFLCommonUtils into ObjC++ if we add the C++ code there. What about creating a new class TFLCommonCppUtils that extends TFLCommonUtils?
We can accept the trade-off that the code will not be very neat to reduce the amount of changes needed.
The problem with the current refactoring is that it caused a lot of changes across many files. When importing the code into internal repo, it leads to many unintentional changes that are very tricky to apply, due to the difference between the GitHub codebase and the internal codebase.
Acked the issue with turning the TFLCommonUtils into ObjC++ if we add the C++ code there. What about creating a new class TFLCommonCppUtils that extends TFLCommonUtils?
We can accept the trade-off that the code will not be very neat to reduce the amount of changes needed.
The problem with the current refactoring is that it caused a lot of changes across many files. When importing the code into internal repo, it leads to many unintentional changes that are very tricky to apply, due to the difference between the GitHub codebase and the internal codebase.
Got it. I'll retain the C functions in TFLCommonUtils and extend it for Cpp. Also, I think I'll have to revert the folder structure changes.
Acked the issue with turning the TFLCommonUtils into ObjC++ if we add the C++ code there. What about creating a new class TFLCommonCppUtils that extends TFLCommonUtils?
We can accept the trade-off that the code will not be very neat to reduce the amount of changes needed.
The problem with the current refactoring is that it caused a lot of changes across many files. When importing the code into internal repo, it leads to many unintentional changes that are very tricky to apply, due to the difference between the GitHub codebase and the internal codebase.
I have raised a new PR for these changes: https://github.com/tensorflow/tflite-support/pull/866