Skip to content

Commit

Permalink
custom sparse arg notes for each function
Browse files Browse the repository at this point in the history
  • Loading branch information
amjames committed Oct 5, 2022
1 parent 61dd23b commit 4039960
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions torch/_torch_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ def merge_dicts(*dicts):
}

sparse_support_notes = {
"sparse_arg_support": """This operation has support for arguments with :ref:`sparse layouts<sparse-docs>` \
the layout of all operands will determine the output layout. In the case where attr:`out` is provided it's layout will \
used without modification. In general more layouts are supported when a single argument is sparse, if all \
arguments have sparse layout fewer combinations will be supported. """,
"sparse_beta_warning": """
.. warning::
Sparse support is a beta feature and some layout(s)/dtype/device combinations may not be supported,
Expand Down Expand Up @@ -547,7 +543,9 @@ def merge_dicts(*dicts):
For inputs of type `FloatTensor` or `DoubleTensor`, arguments :attr:`beta` and
:attr:`alpha` must be real numbers, otherwise they should be integers.
{sparse_arg_support}
This operation has support for arguments with :ref:`sparse layouts<sparse-docs>`. If
:attr:`input` is sparse the result will have the same layout and if :attr:`out`
is provided it should have the same layout as :attr:`input`.
{sparse_beta_warning}
Expand Down Expand Up @@ -7477,7 +7475,9 @@ def merge_dicts(*dicts):
Supports strided and sparse 2-D tensors as inputs, autograd with
respect to strided inputs.
{sparse_arg_support}
This operation has support for arguments with :ref:`sparse layouts<sparse-docs>`.
If :attr:`out` is provided it's layout will be used. Otherwise, the result
layout will be deduced from that of :attr:`input`.
{sparse_beta_warning}
Expand Down Expand Up @@ -7557,7 +7557,9 @@ def merge_dicts(*dicts):
tensor, these inputs are valid for broadcasting even though the final two dimensions (i.e. the
matrix dimensions) are different. :attr:`out` will be a :math:`(j \times k \times n \times p)` tensor.
{sparse_arg_support}
This operation has support for arguments with :ref:`sparse layouts<sparse-docs>`. In particular the
matrix-matrix (both arguments 2-dimensional) supports sparse arguments with the same restrictions
as :func:`torch.mm`
{sparse_beta_warning}
Expand Down

0 comments on commit 4039960

Please sign in to comment.