Skip to content

Commit

Permalink
fix: add super().__init__ in the ContrastiveLoss Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
bdvllrs committed Jan 23, 2024
1 parent 6f9f6c5 commit 41f8f6d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shimmer/modules/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def __init__(
logit_scale: torch.Tensor,
reduction: Literal["mean", "sum", "none"] = "mean",
) -> None:
super().__init__()

self.register_buffer("logit_scale", logit_scale)
self.reduction: Literal["mean", "sum", "none"] = reduction

Expand Down Expand Up @@ -88,6 +90,8 @@ def __init__(
logit_scale: torch.Tensor,
reduction: Literal["mean", "sum", "none"] = "mean",
) -> None:
super().__init__()

self.register_buffer("logit_scale", logit_scale)
self.reduction: Literal["mean", "sum", "none"] = reduction

Expand Down

0 comments on commit 41f8f6d

Please sign in to comment.