Skip to content

Conversation

datumbox
Copy link
Contributor

@datumbox datumbox commented Jul 5, 2022

The current implementation skips the method calls when a class is subclassed:

import torchvision


class ResNet50(torchvision.models.ResNet):
    pass

m = ResNet50(torchvision.models.resnet.Bottleneck, [3, 4, 23, 3])

With this patch, the call will happen using the torchvision.internal prefix.

@datumbox datumbox merged commit 329b978 into pytorch:main Jul 5, 2022
@datumbox datumbox deleted the utils/module_name branch July 5, 2022 10:40
facebook-github-bot pushed a commit that referenced this pull request Jul 6, 2022
…#6237)

Summary:
* Make `_log_api_usage_once` work for overwritten classes

* Change module prefix to `torchvision.internal`

Reviewed By: jdsgomes

Differential Revision: D37643911

fbshipit-source-id: b5c817701bb95a7213ad51b041adb014724ed124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants