Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ilemhadri/lassonet
Browse files Browse the repository at this point in the history
  • Loading branch information
louisabraham committed Jan 12, 2024
2 parents 3b0d1b4 + ead7a45 commit f812926
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lassonet/cox.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def forward(self, log_h, y):
events = events[idx]

event_ind = events.nonzero().flatten()

if event_ind.nelement() == 0:
return torch.tensor(0.0)

# numerator
log_num = log_h[event_ind].mean()

Expand Down

0 comments on commit f812926

Please sign in to comment.