Skip to content

Commit 159d142

Browse files
authored
Merge pull request BIMSBbioinfo#140 from huseyincavusbi/main
Update GNN tutorial with FLEXYNESIS_CACHE and fix notebook warnings
2 parents dffa7d0 + e74179a commit 159d142

File tree

2 files changed

+3393
-1280
lines changed

2 files changed

+3393
-1280
lines changed

examples/tutorials/gnn_custom_networks.ipynb

Lines changed: 3391 additions & 1278 deletions
Large diffs are not rendered by default.

flexynesis/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ def get_torch_dataset(self, dat, ann, samples):
425425
ann, variable_types, label_mappings = self.encode_labels(ann)
426426

427427
# Convert DataFrame to tensor with MPS-compatible dtypes
428-
ann = {col: torch.from_numpy(ann[col].values).float() if ann[col].dtype in ['float64', 'float32']
429-
else torch.from_numpy(ann[col].values) for col in ann.columns}
428+
ann = {col: torch.from_numpy(ann[col].values.copy()).float() if ann[col].dtype in ['float64', 'float32']
429+
else torch.from_numpy(ann[col].values.copy()) for col in ann.columns}
430430
return MultiOmicDataset(dat, ann, variable_types, features, samples, label_mappings)
431431

432432
def encode_labels(self, df):

0 commit comments

Comments
 (0)