bert
bert copied to clipboard
function embedding_lookup in modeling.py have conflict 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.