-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Update meta-data documentation #5842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @datumbox
Should we rename the meta
field into _meta
as well?
@NicolasHug We definitely can. I hesitated doing this because we use a dataclass for Weights and this would likely make it look ugly on the constructor call. I decided to bring a PR and decide on the spot with you and @jdsgomes. I would rather avoid renaming |
My concern is that documenting that something is private is usually not enough for users not to use it. On top of that, I'm not sure these docs will actually get rendered anywhere (will they?). I'm personally not too concerned about using class Weights:
def __init__(self, url, transforms, meta):
self.url = url
self.transforms = transforms
self._meta = meta Unless there's some killer feature from dataclasses that I'm missing? |
@NicolasHug I think the use of dataclasses is from the time when the enums stored the data directly in them. I don't think there is a specific feature we need. Let me try make the change here and see if all work well. |
913b3fd
to
f3a1f51
Compare
It's been a while since I've worked on this part of the code-base so I had to refresh my memory about it. The meta-data as they are now store two types of info:
One clean option is to separate the two and provide different guarantees for each. A bit of an overkill but I don't see a better way if we want to be super consistent. Thoughts? |
After sleeping over it, my preferred solution is not to generate a bunch of different doc fields but instead clean up the current ones (remove unnecessary fields see #5768) and restructure existing fields such as metrics. This way we can still offer a great level of BC, excluding things like URLs that are purely informational and can change / move on the future. Thoughts? |
Something like a I'm not sure I fully get your last comment, happy to chat more :) |
@NicolasHug Sorry for not being very clear. I'm proposing cleaning up the meta-data fields to keep only the bare minimum for which we can offer BC compatibility. With the exclusion of recipe URLs which can change to reflect the most updated info, all other fields like categories, num_params etc can be considered frozen and BC. |
I had an offline chat with @NicolasHug and we agreed to strip the I'm closing this PR and I'll follow up with a new one that further cleans up the fields and restructures them. |
It's quite likely that on future versions of TorchVision, we will have to modify the meta-data stored along with the weights. I believe that those meta-data are documentation and not code and as a result we should be able to modify them (add, delete, edit fields) on the future.
This PR adds a note on the documentation to clarify that there are no BC guarantees on meta-data.