codertimo / BERT-pytorch

Google AI 2018 BERT pytorch implementation
Apache License 2.0
6.11k stars 1.29k forks source link

What should be the shapes and example of values of x and segment_info in BERT.forward? #48

Open komelianchuk opened 5 years ago

komelianchuk commented 5 years ago

I'm trying to add BERT as trainable part to my model and want to pass some data to it. Could you complete my code example with some x and segment_info?

from bert_pytorch import BERT
N = 30000
bert_model = BERT(N)
x = ...
segment_info = ...
bert_model.forward(x, segment_info)