Skip to content

Commit

Permalink
fix: handle extra arguments to validate
Browse files Browse the repository at this point in the history
  • Loading branch information
samedii committed Nov 28, 2023
1 parent 645eb12 commit 265389c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lantern/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __get_validators__(cls):
yield cls.validate

@classmethod
def validate(cls, data) -> np.ndarray:
def validate(cls, data, config=None, field=None) -> np.ndarray:
if isinstance(data, cls):
return data.view(np.ndarray)
elif isinstance(data, np.ndarray):
Expand Down
2 changes: 1 addition & 1 deletion lantern/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __get_validators__(cls):
yield cls.validate

@classmethod
def validate(cls, data) -> torch.Tensor:
def validate(cls, data, config=None, field=None) -> torch.Tensor:
if isinstance(data, cls):
return torch.tensor(data)
elif isinstance(data, torch.Tensor):
Expand Down

0 comments on commit 265389c

Please sign in to comment.