Fix docs build (#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: https://github.com/pytorch/pytorch/pull/155129
Approved by: https://github.com/janeyx99, https://github.com/svekars
This commit is contained in:
albanD
2025-06-09 22:25:16 +00:00
committed by PyTorch MergeBot
parent 034a7f6437
commit bdbf2792a8

View File

@ -36,14 +36,14 @@ class CausalVariant(IntEnum):
Defines two types of causal biases:
`UPPER_LEFT`: Represents upper-left triangular bias for standard causal attention.
``UPPER_LEFT``: Represents upper-left triangular bias for standard causal attention.
The equivalent pytorch code for constructing this bias is:
.. code-block:: python
torch.tril(torch.ones(size, dtype=torch.bool))
For instance, with `shape=(3,4)`, the materialized bias tensor will be:
For instance, with ``shape=(3,4)``, the materialized bias tensor will be:
.. code-block:: text
@ -52,7 +52,7 @@ class CausalVariant(IntEnum):
[1, 1, 1, 0]]
`LOWER_RIGHT`: Represents lower-right triangular bias, the include values are aligned to the lower
``LOWER_RIGHT``: Represents lower-right triangular bias, the include values are aligned to the lower
right corner of the matrix.
The equivalent pytorch code for constructing this bias is:
@ -65,7 +65,7 @@ class CausalVariant(IntEnum):
diagonal=diagonal_offset,
)
For instance, with `shape=(3,4)`, the materialized bias tensor will be:
For instance, with ``shape=(3,4)``, the materialized bias tensor will be:
.. code-block:: text