Skip to content

Commit d536e0d

Browse files
committed
typo
1 parent 632a178 commit d536e0d

File tree

16 files changed

+380
-13
lines changed

16 files changed

+380
-13
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The package consists of the following operations:
2828
* [**Scatter Mul**](https://rusty1s.github.io/pytorch_scatter/build/html/functions/mul.html)
2929
* [**Scatter Div**](https://rusty1s.github.io/pytorch_scatter/build/html/functions/div.html)
3030
* [**Scatter Mean**](https://rusty1s.github.io/pytorch_scatter/build/html/functions/mean.html)
31+
* [**Scatter Std**](https://rusty1s.github.io/pytorch_scatter/build/html/functions/std.html)
3132
* [**Scatter Min**](https://rusty1s.github.io/pytorch_scatter/build/html/functions/min.html)
3233
* [**Scatter Max**](https://rusty1s.github.io/pytorch_scatter/build/html/functions/max.html)
3334

docs/source/_figures/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
files=(add sub mul div mean max min)
3+
files=(add sub mul div mean max min std)
44

55
for name in "${files[@]}"; do
66
pdflatex "$name"

docs/source/_figures/std.svg

Lines changed: 295 additions & 0 deletions
Loading

docs/source/_figures/std.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
\def\indices{{0, 0, 1, 0, 2, 2, 3, 3}}
2+
\def\inputs{{5, 1, 7, 2, 3, 2, 1, 3}}
3+
\def\outputs{{2.1, 0, 0.7, 1.4}}
4+
\def\colors{{"cyan", "orange", "olive", "magenta"}}
5+
\def\numberInputs{7}
6+
\def\numberOutputs{3}
7+
\def\operation{std}
8+
\input{template}

docs/source/functions/std.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Scatter Std
2+
===========
3+
4+
.. automodule:: torch_scatter
5+
6+
.. autofunction:: scatter_std

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
['cuda/scatter.cpp', 'cuda/scatter_kernel.cu'])
1616
]
1717

18-
__version__ = '1.0.5'
18+
__version__ = '1.1.0'
1919
url = 'https://github.com/rusty1s/pytorch_scatter'
2020

2121
install_requires = []
@@ -36,5 +36,4 @@
3636
tests_require=tests_require,
3737
ext_modules=ext_modules,
3838
cmdclass=cmdclass,
39-
packages=find_packages(),
40-
)
39+
packages=find_packages(), )

test/test_std.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from itertools import product
2+
3+
import pytest
4+
import torch
5+
from torch_scatter import scatter_std
6+
7+
from .utils import grad_dtypes as dtypes, devices, tensor
8+
9+
biass = [True, False]
10+
11+
12+
@pytest.mark.parametrize('dtype,device,bias', product(dtypes, devices, biass))
13+
def test_std(dtype, device, bias):
14+
src = tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]], dtype, device)
15+
index = tensor([[0, 0, 0, 0, 0], [1, 1, 1, 1, 1]], torch.long, device)
16+
17+
out = scatter_std(src, index, dim=-1, unbiased=bias)
18+
expected = src.std(dim=-1, unbiased=bias)
19+
assert out.tolist() == [[expected[0].item(), 0], [0, expected[0].item()]]

torch_scatter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .max import scatter_max
88
from .min import scatter_min
99

10-
__version__ = '1.0.5'
10+
__version__ = '1.1.0'
1111

1212
__all__ = [
1313
'scatter_add',

torch_scatter/add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def scatter_add(src, index, dim=-1, out=None, dim_size=None, fill_value=0):
1313
|
1414
1515
Sums all values from the :attr:`src` tensor into :attr:`out` at the indices
16-
specified in the :attr:`index` tensor along an given axis :attr:`dim`. For
16+
specified in the :attr:`index` tensor along a given axis :attr:`dim`. For
1717
each value in :attr:`src`, its output index is specified by its index in
1818
:attr:`input` for dimensions outside of :attr:`dim` and by the
1919
corresponding value in :attr:`index` for dimension :attr:`dim`. If

torch_scatter/div.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def scatter_div(src, index, dim=-1, out=None, dim_size=None, fill_value=1):
3939
|
4040
4141
Divides all values from the :attr:`src` tensor into :attr:`out` at the
42-
indices specified in the :attr:`index` tensor along an given axis
42+
indices specified in the :attr:`index` tensor along a given axis
4343
:attr:`dim`.If multiple indices reference the same location, their
4444
**contributions divide** (`cf.` :meth:`~torch_scatter.scatter_add`).
4545

0 commit comments

Comments
 (0)