jboth's picture
Upload pytorch3d_stub/pytorch3d/__init__.py with huggingface_hub
9581637 verified
raw
history blame contribute delete
682 Bytes
"""pytorch3d stub package with catch-all for missing submodules."""
import importlib
import warnings
__version__ = "0.0.0-stub"
def __getattr__(name):
if name.startswith("__") and name.endswith("__"):
raise AttributeError(name)
# Try importing submodule first
try:
return importlib.import_module(f".{name}", __name__)
except ImportError:
pass
warnings.warn(f"pytorch3d stub: {name} not implemented", stacklevel=2)
class _Dummy:
def __init__(self, *a, **kw): pass
def __call__(self, *a, **kw): return None
def to(self, *a, **kw): return self
_Dummy.__name__ = _Dummy.__qualname__ = name
return _Dummy