Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2020 09:06
What would you like to do?
import torch
def main():
# Rest of the training code
# OR
class MyNumericallyUnstableLoss(nn.Module):
def forward(self, input, target):
with torch.autograd.set_detect_anomaly(True):
loss = input * target
return loss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment