Skip to content

Commit

Permalink
fix nn docs
Browse files Browse the repository at this point in the history
  • Loading branch information
plutonium-239 committed Aug 28, 2024
1 parent 7a75a74 commit 4dc6ebf
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ torchview-output/

# generated docs
docs_src/_build/
docs_src/api/nn/
docs_src/api/nn/memsave_torch.nn*
24 changes: 24 additions & 0 deletions docs_src/api/nn/functional/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
functional
===========

.. module:: memsave_torch.nn.functional

.. For some reason, linking to :mod:`torch.nn.functional` does not point to the correct documentation
This module tries to mirror the :external+torch:doc:`nn.functional` module, offering layer operations as functions, where you need to provide the inputs to the layer, the layer parameters and any other options it might need.

This module contains the following members:

* :func:`batch_normMemSave`
* :func:`convMemSave`
* :func:`dropoutMemSave`
* :func:`linearMemSave`
* :func:`maxpool2dMemSave`
* :func:`reluMemSave`

.. autofunction:: batch_normMemSave
.. autofunction:: convMemSave
.. autofunction:: dropoutMemSave
.. autofunction:: linearMemSave
.. autofunction:: maxpool2dMemSave
.. autofunction:: reluMemSave
66 changes: 66 additions & 0 deletions docs_src/api/nn/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
nn
===

This module tries to mirror the :mod:`torch.nn` module, offering all available layers to be readily replaced by calling the :func:`convert_to_memory_saving()` function.
This module contains the following members:

* :func:`convert_to_memory_saving <memsave_torch.nn.convert_to_memory_saving>`
* :class:`MemSaveConv1d <memsave_torch.nn.MemSaveConv1d>`
* :class:`MemSaveConv2d <memsave_torch.nn.MemSaveConv2d>`
* :class:`MemSaveConv3d <memsave_torch.nn.MemSaveConv3d>`
* :class:`MemSaveConvTranspose1d <memsave_torch.nn.MemSaveConvTranspose2d>`
* :class:`MemSaveConvTranspose2d <memsave_torch.nn.MemSaveConvTranspose2d>`
* :class:`MemSaveConvTranspose3d <memsave_torch.nn.MemSaveConvTranspose2d>`
* :class:`MemSaveLinear <memsave_torch.nn.MemSaveLinear>`
* :class:`MemSaveReLU <memsave_torch.nn.MemSaveReLU>`
* :class:`MemSaveMaxPool2d <memsave_torch.nn.MemSaveMaxPool2d>`
* :class:`MemSaveBatchNorm2d <memsave_torch.nn.MemSaveBatchNorm2d>`

This module also contains the submodule :mod:`memsave_torch.nn.functional`, which tries to mirror the :mod:`torch.nn.functional` module, offering layer operations as functions.

.. toctree::
:hidden:

functional/index

.. module:: memsave_torch.nn

.. autofunction:: convert_to_memory_saving

Learnable Layers
------------------

.. autosummary::
:toctree:
:template: torch_module_extension.rst
:nosignatures:

MemSaveConv1d
MemSaveConv2d
MemSaveConv3d
MemSaveConvTranspose1d
MemSaveConvTranspose2d
MemSaveConvTranspose3d
MemSaveLinear


Activations and Pooling Layers
--------------------------------

.. autosummary::
:toctree:
:template: torch_module_extension.rst
:nosignatures:

MemSaveReLU
MemSaveMaxPool2d

Normalization Layers
--------------------------

.. autosummary::
:toctree:
:template: torch_module_extension.rst
:nosignatures:

MemSaveBatchNorm2d

0 comments on commit 4dc6ebf

Please sign in to comment.