Like the code shown below. It notified me that I was trying to use some graph that had been freed but I could not find why.

  
      gist.github.com
  
  
    https://gist.github.com/santisy/5c3b8e15f13c1c1719fabfd105c970df 9
bug_report1.py
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn import Parameter

def _l2normalize(v, eps=1e-12):
    return v / (torch.norm(v, p=2) + eps)

def max_singular_value(W, u=None, Ip=1):
This file has been truncated. show original




  
  
    
    
  
  


Note: this code is trying to do Spectral Normalization.(https://arxiv.org/pdf/1802.05957.pdf)