google-research / bigbird

Transformers for Longer Sequences
https://arxiv.org/abs/2007.14062
Apache License 2.0
563 stars 101 forks source link

Unconditional assert False in bigbird/core/utils.py #11

Open michaelmherrera opened 3 years ago

michaelmherrera commented 3 years ago

Hi,

I wanted to point out that in bigbird/core/utils.py at line 58, there is an unconditional assert False:

assert False, "Static shape not available for {}".format(tensor)

However, there is code after the assert statment. If I'm not mistaken, that means it is dead code:

  assert False, "Static shape not available for {}".format(tensor)

  dyn_shape = tf.shape(tensor)
  for index in non_static_indexes:
    shape[index] = dyn_shape[index]
  return shape