removed __init__ return type annotation
Jonas Rauber
4 years ago
23 | 23 |
"""A wrapper for modules that delays the import until it is needed
|
24 | 24 |
and wraps the output of functions as EagerPy tensors"""
|
25 | 25 |
|
26 | |
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
26 |
def __init__(self, *args: Any, **kwargs: Any):
|
27 | 27 |
super().__init__(*args, **kwargs)
|
28 | 28 |
if self.__doc__ is None:
|
29 | 29 |
self.__doc__ = f"EagerPy wrapper of the '{self.__name__}' module"
|
16 | 16 |
class BaseTensor(Tensor):
|
17 | 17 |
__slots__ = "_raw"
|
18 | 18 |
|
19 | |
def __init__(self: TensorType, raw: Any) -> None:
|
|
19 |
def __init__(self: TensorType, raw: Any):
|
20 | 20 |
assert not isinstance(raw, Tensor)
|
21 | 21 |
self._raw = raw
|
22 | 22 |
|
42 | 42 |
|
43 | 43 |
|
44 | 44 |
class ExtensionMethods(metaclass=GenericExtensionMeta):
|
45 | |
def __init__(self, instance: Tensor) -> None:
|
|
45 |
def __init__(self, instance: Tensor):
|
46 | 46 |
self._instance = instance
|
47 | 47 |
|
48 | 48 |
|
33 | 33 |
|
34 | 34 |
# supports lazy extension loading to break cyclic dependencies
|
35 | 35 |
|
36 | |
def __init__(self, cache_name: str, extension_name: str) -> None:
|
|
36 |
def __init__(self, cache_name: str, extension_name: str):
|
37 | 37 |
self._cache_name = cache_name
|
38 | 38 |
self._extension_name = extension_name
|
39 | 39 |
|
|
75 | 75 |
__module__ = "eagerpy"
|
76 | 76 |
|
77 | 77 |
@abstractmethod
|
78 | |
def __init__(self, raw: Any) -> None:
|
|
78 |
def __init__(self, raw: Any):
|
79 | 79 |
...
|
80 | 80 |
|
81 | 81 |
@property
|