diff --git a/.gitignore b/.gitignore index 7f71819..80b3e6c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ torchview-output/ # generated docs docs_src/_build/ -docs_src/api/nn/ \ No newline at end of file +docs_src/api/nn/memsave_torch.nn* \ No newline at end of file diff --git a/docs_src/api/nn/functional/index.rst b/docs_src/api/nn/functional/index.rst new file mode 100644 index 0000000..1556b55 --- /dev/null +++ b/docs_src/api/nn/functional/index.rst @@ -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 diff --git a/docs_src/api/nn/index.rst b/docs_src/api/nn/index.rst new file mode 100644 index 0000000..e456693 --- /dev/null +++ b/docs_src/api/nn/index.rst @@ -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 ` +* :class:`MemSaveConv1d ` +* :class:`MemSaveConv2d ` +* :class:`MemSaveConv3d ` +* :class:`MemSaveConvTranspose1d ` +* :class:`MemSaveConvTranspose2d ` +* :class:`MemSaveConvTranspose3d ` +* :class:`MemSaveLinear ` +* :class:`MemSaveReLU ` +* :class:`MemSaveMaxPool2d ` +* :class:`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