Skip to content

Commit

Permalink
fix v2.Lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier committed May 8, 2023
1 parent 0370134 commit 93c2d45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchvision/transforms/v2/_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ class Lambda(Transform):
lambd (function): Lambda/function to be used for transform.
"""

_transformed_types = (object,)

def __init__(self, lambd: Callable[[Any], Any], *types: Type):
super().__init__()
self.lambd = lambd
self.types = types or (object,)
self.types = types or self._transformed_types

def _transform(self, inpt: Any, params: Dict[str, Any]) -> Any:
if isinstance(inpt, self.types):
Expand Down

0 comments on commit 93c2d45

Please sign in to comment.