A-Unified-Framework-for-Deep-Attribute-Graph-Clustering
A-Unified-Framework-for-Deep-Attribute-Graph-Clustering copied to clipboard
[BUG] run HSAN on cpu/cuda
I tried to run HSAN on cpu ( args.device is "cpu") but an exception was raised.
I noticed that .cuda()
methods are called on the pytorch tensors pos_weight
/pos_neg_weight
when creating HardSampleAwareNetwork
instance. All tensors should respect the args.device
and all model parameters should be moved as a whole between CPU and GPU. PyTorch would move all registered parameters when .to(device)
is called on a module. So I think maybe we should treat pos_weight
/pos_neg_weight
as parameters of the HSAN module.