You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use lazy load to avoid loading libtensorflow_io.so until needed. (#1208)
* Use lazy load to avoid loading libtensorflow_io.so until needed.
In tensorflow-io we have two shared libraries:
- `libtensorflow_io.so` is linked with TF C++ API and does not have forward compatibility
- `libtensorflow_io_plugins.so` is linked with TF C API and does have forward compatibility
The plan is to eventually have libtensorflow_io.so linked to TF C API only
but that will take a long time and requires rewriting C++ kernel (after modular kernel API is available in TF, unknown status now).
With both `libtensorflow_io.so` and `libtensorflow_plugins.so` loaded in `import tensorflow_io as tfio`,
the tensorflow-io package is not forward compatible even though our file systems implementations are forward compatible already.
In the meantime, one way to allow forward compatible for file systems, is to lazy load `libtensorflow_io.so`:
- When user tries to run some function like `decode_json` they still encounter errors if they have newer versions of TF.
- However, thwn user tries to just use the file system feature (e.g., azfs/http/etc), it works with newer versions of TF with tensorflow-io through `import tensorflow_io as tfio` (not touching any other submodules in `tensorflow_io`).
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Added tfio.experimental.oss() function to load OSS file system explicitly
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
0 commit comments