File size: 682 Bytes
265a8b1
 
 
 
3bbaee5
265a8b1
 
9581637
265a8b1
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""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