Skip to content

Commit

Permalink
doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Aug 13, 2018
1 parent 0f284ac commit 8313ae1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions torch_geometric/transforms/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class Cartesian(object):
.. testoutput::
tensor([[ 0.7500, 0.5000],
[ 0.2500, 0.5000],
[ 1.0000, 0.5000],
[ 0.0000, 0.5000]])
tensor([[0.7500, 0.5000],
[0.2500, 0.5000],
[1.0000, 0.5000],
[0.0000, 0.5000]])
"""

def __init__(self, cat=True):
Expand Down
4 changes: 2 additions & 2 deletions torch_geometric/transforms/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class Compose(object):
.. testoutput::
tensor([[ 0.7500, 0.5000, 1.0000],
[ 1.0000, 0.5000, 1.0000]])
tensor([[0.7500, 0.5000, 1.0000],
[1.0000, 0.5000, 1.0000]])
"""

def __init__(self, transforms):
Expand Down
8 changes: 4 additions & 4 deletions torch_geometric/transforms/local_cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class LocalCartesian(object):
.. testoutput::
tensor([[ 1.0000, 0.5000],
[ 0.2500, 0.5000],
[ 1.0000, 0.5000],
[ 0.0000, 0.5000]])
tensor([[1.0000, 0.5000],
[0.2500, 0.5000],
[1.0000, 0.5000],
[0.0000, 0.5000]])
"""

def __init__(self, cat=True):
Expand Down
8 changes: 4 additions & 4 deletions torch_geometric/transforms/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Polar(object):
.. testoutput::
tensor([[ 0.5000, 0.0000],
[ 0.5000, 0.5000],
[ 1.0000, 0.2500],
[ 1.0000, 0.7500]])
tensor([[0.5000, 0.0000],
[0.5000, 0.5000],
[1.0000, 0.2500],
[1.0000, 0.7500]])
"""

def __init__(self, cat=True):
Expand Down
4 changes: 2 additions & 2 deletions torch_geometric/transforms/spherical.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Spherical(object):
.. testoutput::
tensor([[ 1.0000, 0.2500, 0.0000],
[ 1.0000, 0.7500, 1.0000]])
tensor([[1.0000, 0.2500, 0.0000],
[1.0000, 0.7500, 1.0000]])
"""

def __init__(self, cat=True):
Expand Down
8 changes: 4 additions & 4 deletions torch_geometric/transforms/target_indegree.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class TargetIndegree(object):
.. testoutput::
tensor([[ 1.0000],
[ 0.5000],
[ 0.5000],
[ 1.0000]])
tensor([[1.0000],
[0.5000],
[0.5000],
[1.0000]])
"""

def __init__(self, cat=True):
Expand Down
2 changes: 1 addition & 1 deletion torch_geometric/utils/degree.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def degree(index, num_nodes=None, dtype=None, device=None):
.. testoutput::
tensor([ 3., 1., 1.])
tensor([3., 1., 1.])
"""
num_nodes = maybe_num_nodes(index, num_nodes)
out = torch.zeros((num_nodes), dtype=dtype, device=device)
Expand Down

0 comments on commit 8313ae1

Please sign in to comment.