Hi, I thought i’m doing think right, but got this error
features = torch.from_numpy(features).cuda()
print(features.device) #  shows cuda:0
dists = self.calculate_distance(features).cuda()
print(dists.device) # shows cuda:0
dists.add_(torch.tril(100 * torch.ones(len(features), len(features))))

But the last line fails with error RuntimeError: expected device cuda:0 and dtype Float but got device cpu and dtype Float
Anything I’m doing wrong?
Thank you