tensorflow / datasets

TFDS is a collection of datasets ready to use with TensorFlow, Jax, ...
https://www.tensorflow.org/datasets
Apache License 2.0
4.29k stars 1.54k forks source link

[GSoC] Better lazy_imports usability #1945

Open Conchylicultor opened 4 years ago

Conchylicultor commented 4 years ago

Part1: Currently, lazy imports feels counter intuitive and confusing. It would be nice to improve the API to allow something like:

with tfds.core.lazy_imports():
  import some_module

It would patch the default module import:

with tfds.core.lazy_imports():
  import some_module

some_module.some_function()  # Raise the lazy import error (please install some_module)
vijayphoenix commented 4 years ago

Working on this!