connorlee77 / pytorch-mutual-information

Mutual Information in Pytorch
103 stars 10 forks source link

Take a look at the error msg. #4

Closed redLinmumu closed 1 year ago

redLinmumu commented 1 year ago

MutualInformation.py", line 14, in init self.bins = nn.Parameter(torch.linspace(0, 255, num_bins, device=device).float(), requires_grad=False) NameError: name 'device' is not defined

huynhtuan17ti commented 1 year ago

You can specify a global variable device=....

connorlee77 commented 1 year ago

Nice catch! Fixed.