In version v3.x:
bash
from transformers.modeling_bert import BertLayer
to obtain the same in version v4.x:
bash
from transformers.models.bert.modeling_bert import BertLayer
4. Switching the return_dict argument to True by default
The return_dict argument enables the return of dict-like python objects containing the model outputs, instead of the standard tuples. This object is self-documented as keys can be used to retrieve values, while also behaving as a tuple as users may retrieve objects by index or by slice.
This is a breaking change as the limitation of that tuple is that it cannot be unpacked: value0, value1 = outputs will not work.
How to obtain the same behavior as v3.x in v4.x
In order to obtain the same behavior as version v3.x, you should specify the return_dict argument to False, either in the model configuration or during the forward pass.
