mit-han-lab / torchsparse

[MICRO'23, MLSys'22] TorchSparse: Efficient Training and Inference Framework for Sparse Convolution on GPUs.
https://torchsparse.mit.edu
MIT License
1.22k stars 143 forks source link

[BUG] Conv3d: Inconsistent docs on bias=True|False #318

Closed francotheengineer closed 3 months ago

francotheengineer commented 4 months ago

Is there an existing issue for this?

Current Behavior

In the docs, it clearly shows that bias=False in the default function typing/defaults:

class Conv3d(..., bias: [bool](https://docs.python.org/3/library/functions.html#bool) = False, ...) = None)

The codebase also has bias set to False:

class Conv3d(nn.Module):
    def __init__(
        self,
        in_channels: int,
        out_channels: int,
        kernel_size: Union[int, List[int], Tuple[int, ...]] = 3,
        stride: Union[int, List[int], Tuple[int, ...]] = 1,
        padding: Union[int, Tuple[int, ...]] = 0,
        dilation: int = 1,
        bias: bool = False,
        transposed: bool = False,
        generative: bool = False,
        config: Dict = None,
    ) -> None:

But the doc string states the inverse: bias ([bool](https://docs.python.org/3/library/functions.html#bool)) – If True, add a learnable bias to the output. Default: True.

This is different from PyTorch Questions: 1) Am I correct in thinking that bias, by default, is False?
2) Why is bias not commonly used in sparse conv networks?

Expected Behavior

No response

Environment

- GCC: N/A
- NVCC: N/A
- PyTorch: N/A
- PyTorch CUDA: N/A
- TorchSparse: N/A

Anything else?

No response

zhijian-liu commented 3 months ago

Please follow the definition in the code. Thanks!