Skip to content

API Reference

__all__ module-attribute

__all__ = ['enable', 'disable', 'no_weight_grad', 'conv2d', 'conv_transpose2d']

__author__ module-attribute

__author__ = 'Peter Yuen'

__email__ module-attribute

__email__ = 'ppeetteerrsx@gmail.com'

__version__ module-attribute

__version__ = metadata.version('torch_conv_gradfix')

no_weight_grad module-attribute

no_weight_grad: Type[ContextManager[None]] = None

__docs

__docs()

Build gh-pages documentation branch.

Source code in torch_conv_gradfix/__init__.py
37
38
39
40
41
42
43
44
def __docs():  # pragma: no cover
    """
    Build gh-pages documentation branch.
    """
    shell(
        "cp README.md docs/index.md && \
            mkdocs gh-deploy --force"
    )

__serve

__serve()

Serve local documentation.

Source code in torch_conv_gradfix/__init__.py
27
28
29
30
31
32
33
34
def __serve():  # pragma: no cover
    """
    Serve local documentation.
    """
    shell(
        "cp README.md docs/index.md && \
            mkdocs serve"
    )

__test

__test()

Runs pytest locally and keeps only coverage.xml for GitHub Actions to upload to Codecov.

Source code in torch_conv_gradfix/__init__.py
17
18
19
20
21
22
23
24
def __test():  # pragma: no cover
    """
    Runs pytest locally and keeps only `coverage.xml` for GitHub Actions to upload to Codecov.
    """
    shell(
        "pytest --cov=torch_conv_gradfix --cov-report xml --cov-report term-missing tests \
            && rm -rf .pytest_cache && rm .coverage"
    )

conv2d

conv2d(input: Tensor, weight: Tensor, bias: Optional[Tensor] = None, stride: IntPairOr = 1, padding: IntPairOr = 0, dilation: IntPairOr = 1, groups: int = 1) -> Tensor
Source code in torch_conv_gradfix/namespace.py
11
12
13
14
15
16
17
18
19
20
def conv2d(
    input: Tensor,
    weight: Tensor,
    bias: Optional[Tensor] = None,
    stride: IntPairOr = 1,
    padding: IntPairOr = 0,
    dilation: IntPairOr = 1,
    groups: int = 1,
) -> Tensor:  # pragma: no cover
    ...

conv_transpose2d

conv_transpose2d(input: Tensor, weight: Tensor, bias: Optional[Tensor] = None, stride: IntPairOr = 1, padding: IntPairOr = 0, output_padding: IntPairOr = 0, dilation: IntPairOr = 1, groups: int = 1) -> Tensor
Source code in torch_conv_gradfix/namespace.py
23
24
25
26
27
28
29
30
31
32
33
def conv_transpose2d(
    input: Tensor,
    weight: Tensor,
    bias: Optional[Tensor] = None,
    stride: IntPairOr = 1,
    padding: IntPairOr = 0,
    output_padding: IntPairOr = 0,
    dilation: IntPairOr = 1,
    groups: int = 1,
) -> Tensor:  # pragma: no cover
    ...

disable

disable()
Source code in torch_conv_gradfix/namespace.py
40
41
def disable():  # pragma: no cover
    ...

enable

enable()
Source code in torch_conv_gradfix/namespace.py
36
37
def enable():  # pragma: no cover
    ...