Skip to content

Commit a3098a7

Browse files
albanDpytorchmergebot
authored andcommitted
Add pinned numpy and fix build (pytorch#155129)
Not sure why the online doc build passes but it fails locally with these broken strings... Also pinning numpy version even though it is technically optional to ensure users have the right version as most users have numpy in their environment anyways. Pull Request resolved: pytorch#155129 Approved by: https://github.com/janeyx99, https://github.com/svekars
1 parent 2481c4b commit a3098a7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.ci/docker/requirements-docs.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ sphinx-copybutton==0.5.0
5858
sphinx-design==0.4.0
5959
sphinxcontrib-mermaid==1.0.0
6060
myst-parser==0.18.1
61+
62+
numpy==1.26

torch/nn/attention/bias.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ class CausalVariant(IntEnum):
3636
3737
Defines two types of causal biases:
3838
39-
`UPPER_LEFT`: Represents upper-left triangular bias for standard causal attention.
39+
``UPPER_LEFT``: Represents upper-left triangular bias for standard causal attention.
4040
The equivalent pytorch code for constructing this bias is:
4141
4242
.. code-block:: python
4343
4444
torch.tril(torch.ones(size, dtype=torch.bool))
4545
46-
For instance, with `shape=(3,4)`, the materialized bias tensor will be:
46+
For instance, with ``shape=(3,4)``, the materialized bias tensor will be:
4747
4848
.. code-block:: text
4949
@@ -52,7 +52,7 @@ class CausalVariant(IntEnum):
5252
[1, 1, 1, 0]]
5353
5454
55-
`LOWER_RIGHT`: Represents lower-right triangular bias, the include values are aligned to the lower
55+
``LOWER_RIGHT``: Represents lower-right triangular bias, the include values are aligned to the lower
5656
right corner of the matrix.
5757
5858
The equivalent pytorch code for constructing this bias is:
@@ -65,7 +65,7 @@ class CausalVariant(IntEnum):
6565
diagonal=diagonal_offset,
6666
)
6767
68-
For instance, with `shape=(3,4)`, the materialized bias tensor will be:
68+
For instance, with ``shape=(3,4)``, the materialized bias tensor will be:
6969
7070
.. code-block:: text
7171

0 commit comments

Comments
 (0)