Skip to content

Conversation

@kouyk
Copy link
Owner

@kouyk kouyk commented Jun 1, 2021

What does this PR do?

Make it clear that the forward method now returns a dict instead of tuple.

PR huggingface#8530 switch the default value of return_dict in configurations to True. This caused some older code that relied on return_dict being set to False to break since assigned a dictionary to tuples can have unexpected outcomes such as receiving strings instead.

The phrasing of the introduction under the return section of the forward method for all models currently state that a dictionary will be returned only if return_dict=True is passed or that config.return_dict is set to True. This is no longer valid ever since the default configuration changed, thus it will be beneficial for the readers to update this portion to indicate that return_dict=False needs to be passed to the forward method or config.return_dict needs to be set to False for a tuple to be returned.

This will likely save readers some time when adapting old code.

Make it clear that the `forward` method now returns a dict instead of tuple.
@kouyk kouyk closed this Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants