Hi !
I’m trying to use TFBertModel in Rasa framework, and I found some minor mismatch with function ‘shape_list’ in ‘modeling_tf_utils.py’ and function ‘call’ in TFBertModel
Argument typing says it is okay to pass Union of np.array and tf.Tensor, but I found that when I pass ‘attention_mask’ with np.array, It causes some error in ‘shape_list’ function in ‘modeling_tf_utils.py’
the error is about np.array instance doesn’t have ‘as_list()’ function
So I changed the line 1958 like this
# static = tensor.shape.as_list() # original code
static = list(tensor.shape) # my implementation
I think it didn’t cause any problem and model worked well
So I was wonder about is there any special reason for using tensor.shape.as_list() which only works for tf.Tensor instance
and I thought It would be nice to change it like I did
function ‘input_processing’ in ‘modeling_tf_utils.py’ do not make np.array kwarg s into tf.Tensor so I think my implementation would be nice to be merged.
How do you think about it guys?
Of course I might be wrong so feel free to answer my question!
Thank you! _smile: