Skip to content

Commit

Permalink
deprecate registry
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyuan Chen <[email protected]>
  • Loading branch information
ZhiyuanChen committed Mar 30, 2023
1 parent ea55b48 commit ec7550a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions danling/registry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from copy import deepcopy
from functools import wraps
from typing import Any, Callable, Mapping, Optional, Union
from warnings import warn

from chanfig import NestedDict

Expand Down Expand Up @@ -52,6 +53,10 @@ class Registry(NestedDict):
def __init__(self, override: bool = False):
super().__init__()
self.setattr("override", override)
warn(
"DanLing Registry has been deprecated in favor of CHANfiG Registry, and will be removed in 0.2.0.",
DeprecationWarning,
)

def register(self, component: Optional[Callable] = None, name: Optional[str] = None) -> Callable:
r"""
Expand Down
2 changes: 1 addition & 1 deletion danling/tensors/nested_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def __torch_function__(cls, func, types, args=(), kwargs=None):
def __len__(self) -> int:
return len(self.storage)

def __eq__(self, other) -> Union[bool, Tensor, NestedTensor]:
def __eq__(self, other) -> Union[bool, Tensor, NestedTensor]: # type: ignore[override]
if isinstance(other, NestedTensor):
return self.storage == other.storage
if isinstance(other, Tensor):
Expand Down

0 comments on commit ec7550a

Please sign in to comment.