Skip to content

Commit

Permalink
ensure data is torch in torch_geometric.data
Browse files Browse the repository at this point in the history
  • Loading branch information
afrendeiro committed Aug 28, 2024
1 parent 33facab commit 22402f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wsi/wsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,5 +1907,9 @@ def as_torch_geometric_data(
assert coords is not None, "coords must be provided when feats is not None"

edge_index = self.get_tile_graph()
data = Data(x=feats, edge_index=edge_index, pos=coords)
data = Data(
x=torch.tensor(feats),
edge_index=torch.tensor(edge_index),
pos=torch.tensor(coords),
)
return data

0 comments on commit 22402f1

Please sign in to comment.