Marigoldwu / A-Unified-Framework-for-Deep-Attribute-Graph-Clustering

This project is a scalable unified framework for deep graph clustering.
https://www.marigold.website/readArticle?workId=145&author=Marigold&authorId=1000001
MIT License
100 stars 12 forks source link

[BUG] run HSAN on cpu/cuda #8

Open habaneraa opened 1 year ago

habaneraa commented 1 year ago

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.