Commit e692eff8 authored by rusty1s's avatar rusty1s
Browse files

remove unused padding function

parent aeca5cf7
...@@ -55,7 +55,6 @@ from .rw import random_walk # noqa ...@@ -55,7 +55,6 @@ from .rw import random_walk # noqa
from .metis import partition # noqa from .metis import partition # noqa
from .bandwidth import reverse_cuthill_mckee # noqa from .bandwidth import reverse_cuthill_mckee # noqa
from .saint import saint_subgraph # noqa from .saint import saint_subgraph # noqa
from .padding import padded_index, padded_index_select # noqa
from .sample import sample, sample_adj # noqa from .sample import sample, sample_adj # noqa
from .convert import to_torch_sparse, from_torch_sparse # noqa from .convert import to_torch_sparse, from_torch_sparse # noqa
...@@ -101,8 +100,6 @@ __all__ = [ ...@@ -101,8 +100,6 @@ __all__ = [
'partition', 'partition',
'reverse_cuthill_mckee', 'reverse_cuthill_mckee',
'saint_subgraph', 'saint_subgraph',
'padded_index',
'padded_index_select',
'to_torch_sparse', 'to_torch_sparse',
'from_torch_sparse', 'from_torch_sparse',
'to_scipy', 'to_scipy',
......
from typing import Tuple, List
import torch
from torch_sparse.tensor import SparseTensor
def padded_index(src: SparseTensor, binptr: torch.Tensor
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.
Tensor, List[int], List[int]]:
return torch.ops.torch_sparse.padded_index(src.storage.rowptr(),
src.storage.col(),
src.storage.rowcount(), binptr)
def padded_index_select(src: torch.Tensor, index: torch.Tensor,
fill_value: float = 0.) -> torch.Tensor:
fill_value = torch.tensor(fill_value, dtype=src.dtype)
return torch.ops.torch_sparse.padded_index_select(src, index, fill_value)
SparseTensor.padded_index = padded_index
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment