Question about shape_list function in modeling_tf_utils
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 TFBertModelArgument 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()’ functionSo I changed the line 1958 like this# static = tensor.shape.as_list()  # original code
   static = list(tensor.shape)        # my implementationI think it didn’t cause any problem and model worked wellSo I was wonder about is there any special reason for using tensor.shape.as_list() which only works for tf.Tensor instanceand I thought It would be nice to change it like I didfunction ‘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:image715×404 19 KB