Skip to content

Fix and add missing syntax highlighting for code blocks in documentation #9334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 21, 2024
Merged
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
2 changes: 1 addition & 1 deletion docs/source/tutorial/distributed_pyg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Later on, each node in the cluster then owns a single partition of this graph.

The resulting structure of partitioning for a two-part split on the homogeneous :obj:`ogbn-products` is shown below:

.. code-block::
.. code-block:: none

partitions
└─ obgn-products
Expand Down
6 changes: 3 additions & 3 deletions torch_geometric/data/lightning/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class LightningDataset(LightningDataModule):
speed.html>`__ are supported in order to correctly share data across
all devices/processes:

.. code-block::
.. code-block:: python

import pytorch_lightning as pl
trainer = pl.Trainer(strategy="ddp_spawn", accelerator="gpu",
Expand Down Expand Up @@ -332,7 +332,7 @@ class LightningNodeData(LightningData):
speed.html>`__ are supported in order to correctly share data across
all devices/processes:

.. code-block::
.. code-block:: python

import pytorch_lightning as pl
trainer = pl.Trainer(strategy="ddp_spawn", accelerator="gpu",
Expand Down Expand Up @@ -525,7 +525,7 @@ class LightningLinkData(LightningData):
speed.html>`__ are supported in order to correctly share data across
all devices/processes:

.. code-block::
.. code-block:: python

import pytorch_lightning as pl
trainer = pl.Trainer(strategy="ddp_spawn", accelerator="gpu",
Expand Down
4 changes: 2 additions & 2 deletions torch_geometric/distributed/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Partitioner:

**Homogeneous graphs:**

.. code-block::
.. code-block:: none

root/
|-- META.json
Expand All @@ -40,7 +40,7 @@ class Partitioner:

**Heterogeneous graphs:**

.. code-block::
.. code-block:: none

root/
|-- META.json
Expand Down
4 changes: 2 additions & 2 deletions torch_geometric/nn/aggr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Aggregation(torch.nn.Module):
Notably, :obj:`index` does not have to be sorted (for most aggregation
operators):

.. code-block::
.. code-block:: python

# Feature matrix holding 10 elements with 64 features each:
x = torch.randn(10, 64)
Expand All @@ -39,7 +39,7 @@ class Aggregation(torch.nn.Module):
called :obj:`ptr`. Here, elements within the same set need to be grouped
together in the input, and :obj:`ptr` defines their boundaries:

.. code-block::
.. code-block:: python

# Feature matrix holding 10 elements with 64 features each:
x = torch.randn(10, 64)
Expand Down
1 change: 0 additions & 1 deletion torch_geometric/transforms/node_property_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class NodePropertySplit(BaseTransform):
of the node property, so that nodes with greater values of the
property are considered to be OOD (default: :obj:`True`)

Example:
.. code-block:: python

from torch_geometric.transforms import NodePropertySplit
Expand Down
3 changes: 1 addition & 2 deletions torch_geometric/transforms/pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ class Pad(BaseTransform):
All the attributes of edge types other than these two are padded using a
value of :obj:`1.5`.

Example:
.. code-block::
.. code-block:: python

num_nodes = {'v0': 10, 'v1': 20, 'v2':30}
num_edges = {('v0', 'e0', 'v1'): 80}
Expand Down
2 changes: 1 addition & 1 deletion torch_geometric/transforms/random_link_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RandomLinkSplit(BaseTransform):
in validation and test splits; and the validation split does not include
edges in the test split.

.. code-block::
.. code-block:: python

from torch_geometric.transforms import RandomLinkSplit

Expand Down
Loading