Repository: pytorch/vision

Issue:
Document ResNet architecture tweak
Since we're revamping our docs, we might want to point out that our ResNet implementation slightly differs from the original one:

https://github.com/pytorch/vision/blob/970ba3555794d163daca0ab95240d21e3035c304/torchvision/models/resnet.py#L107:L111

We have this as a comment  in the code but it's worth documenting in the docs as well as `.. note::` IMHO


Discussion:
Another good example of a post-paper optimization adopted in the code-base. I agree we should document this clearly on our new documentation. I was thinking that perhaps the best place to put the note is at the [ResNet doc](https://github.com/pytorch/vision/blob/main/docs/source/models/resnet.rst). What do you think @NicolasHug?
I agree we should add it to the main resnet page. But because some users might land directly on one of the [builder's page](https://pytorch.org/vision/main/models/generated/torchvision.models.resnet18.html#torchvision.models.resnet18) without going from the main Resnet one, I feel like we should also document this in the docstrings. Either by duplicating the same text, or perhaps by just adding a reference to the `.. note`.
Sounds good to me.
Can I send PR with this? 
If so, should I send another PR for docstring? (`https://pytorch.org/vision/main/models/generated/torchvision.models.resnet18.html#torchvision.models.resnet18`)
@puhuk sure, thanks! I think we should be able to tackle all this in a single PR

Resolving patch:
diff --git a/torchvision/models/resnet.py b/torchvision/models/resnet.py
--- a/torchvision/models/resnet.py
+++ b/torchvision/models/resnet.py
@@ -699,6 +699,12 @@ def resnet34(*, weights: Optional[ResNet34_Weights] = None, progress: bool = Tru
 def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
     """ResNet-50 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
 
+    .. note::
+       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
+       convolution while the original paper places it to the first 1x1 convolution.
+       This variant improves the accuracy and is known as `ResNet V1.5
+       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
+
     Args:
         weights (:class:`~torchvision.models.ResNet50_Weights`, optional): The
             pretrained weights to use. See
@@ -724,6 +730,12 @@ def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = Tru
 def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
     """ResNet-101 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
 
+    .. note::
+       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
+       convolution while the original paper places it to the first 1x1 convolution.
+       This variant improves the accuracy and is known as `ResNet V1.5
+       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
+
     Args:
         weights (:class:`~torchvision.models.ResNet101_Weights`, optional): The
             pretrained weights to use. See
@@ -749,6 +761,12 @@ def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = T
 def resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
     """ResNet-152 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
 
+    .. note::
+       The bottleneck of TorchVision places the stride for downsampling to the second 3x3
+       convolution while the original paper places it to the first 1x1 convolution.
+       This variant improves the accuracy and is known as `ResNet V1.5
+       <https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
+
     Args:
         weights (:class:`~torchvision.models.ResNet152_Weights`, optional): The
             pretrained weights to use. See


Test patch: