Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

### Fixed

- Removed `torch.jit.script` calls on `SelectOutput` and `ConnectOutput` to avoid `DeprecationWarning` on PyTorch 2.12 ([#10697](https://github.com/pyg-team/pytorch_geometric/issues/10697))
- Fix MovieLens dataset incompatibility with `sentence-transformers>=5.0.0` ([#10668](https://github.com/pyg-team/pytorch_geometric/pull/10668)
- Removed an unnecessary device synchronization in `torch_geometric.utils.softmax` ([#10499](https://github.com/pyg-team/pytorch_geometric/pull/10499))
- Fixed loading of legacy HuggingFace BERT checkpoints ([#10631](https://github.com/pyg-team/pytorch_geometric/pull/10631))
Expand Down
9 changes: 2 additions & 7 deletions torch_geometric/nn/pool/connect/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from dataclasses import dataclass
from typing import Optional

import torch
Expand All @@ -7,7 +6,6 @@
from torch_geometric.nn.pool.select import SelectOutput


@dataclass(init=False)
class ConnectOutput:
r"""The output of the :class:`Connect` method, which holds the coarsened
graph structure, and optional pooled edge features and batch vectors.
Expand All @@ -20,8 +18,8 @@ class ConnectOutput:
coarsened graph. (default: :obj:`None`)
"""
edge_index: Tensor
edge_attr: Optional[Tensor] = None
batch: Optional[Tensor] = None
edge_attr: Optional[Tensor]
batch: Optional[Tensor]

def __init__(
self,
Expand All @@ -48,9 +46,6 @@ def __init__(
self.batch = batch


ConnectOutput = torch.jit.script(ConnectOutput)


class Connect(torch.nn.Module):
r"""An abstract base class for implementing custom edge connection
operators as described in the `"Understanding Pooling in Graph Neural
Expand Down
7 changes: 1 addition & 6 deletions torch_geometric/nn/pool/select/base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from dataclasses import dataclass
from typing import Optional

import torch
from torch import Tensor


@dataclass(init=False)
class SelectOutput:
r"""The output of the :class:`Select` method, which holds an assignment
from selected nodes to their respective cluster(s).
Expand All @@ -23,7 +21,7 @@ class SelectOutput:
num_nodes: int
cluster_index: Tensor
num_clusters: int
weight: Optional[Tensor] = None
weight: Optional[Tensor]

def __init__(
self,
Expand Down Expand Up @@ -62,9 +60,6 @@ def __init__(
self.weight = weight


SelectOutput = torch.jit.script(SelectOutput)


class Select(torch.nn.Module):
r"""An abstract base class for implementing custom node selections as
described in the `"Understanding Pooling in Graph Neural Networks"
Expand Down
Loading