bert icon indicating copy to clipboard operation
bert copied to clipboard

function embedding_lookup in modeling.py have conflict comments

Open tryagain3 opened this issue 7 years ago • 0 comments

Hi

I am reading the code and found the below comments for embedding_lookup

in the args comments, it says "input_ids is in shape [batch_size, seq_length]" but in the code comments, it says "input_ids is in shape [batch_size, seq_length, num_inputs]" it confused me at first and took me some time to figure it out:

why the input is in shape [batch_size, seq_length] but after the below code "tf.reshape(output, input_shape[0:-1] + [input_shape[-1] * embedding_size])" the output is in shape [batch_size, seq_length, embedding_size]

so a small suggestion here is to update the args comments to make it consistent with the comments in the code.

tryagain3 avatar Feb 28 '19 00:02 tryagain3