Hi everyone, I have a class “MolecularDataset” which has a self.data argument at line 35 to line 39 as shown in the first pic. I want to access this “self.data” argument in a function “data_noniid”  defined outside the class as in the second pic but I have tried both “MolecularDataset.generate.data” and “MolecularDataset.data” but I get an error "AttributeError: ‘function’ object has no attribute ‘data’ ". How can I use the self.data argument in the “data_noniid”.

2760×185 28.9 KB