text: 
  
  TITLE
  AttributeError: 'torch.Size' object has no attribute 'as_list'
  
  COMMENTS
  3
  
  REACTIONS
  +1: 0
  -1: 0
  laugh: 0
  hooray: 0
  heart: 0
  rocket: 0
  eyes: 1
  
  BODY
  Hello, 
  
  I ran the follownig official example script from [longformerforquestionanswering](https://huggingface.co/transformers/model_doc/longformer.html#longformerforquestionanswering)
  
  ```
  # Tokenizer
  tokenizer = LongformerTokenizer.from_pretrained('allenai/longformer-large-4096-finetuned-triviaqa')
  
  # Model
  model = TFLongformerForQuestionAnswering.from_pretrained('allenai/longformer-large-4096-finetuned-triviaqa')
  
  question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
  encoding = tokenizer(question, text, return_tensors="pt")
  input_ids = encoding["input_ids"]
  
  # default is local attention everywhere
  # the forward method will automatically set global attention on question tokens
  attention_mask = encoding["attention_mask"]
  
  outputs = model(input_ids, attention_mask=attention_mask)
  start_logits = outputs.start_logits
  end_logits = outputs.end_logits
  all_tokens = tokenizer.convert_ids_to_tokens(input_ids[0].tolist())
  
  answer_tokens = all_tokens[torch.argmax(start_logits) :torch.argmax(end_logits)+1]
  answer = tokenizer.decode(tokenizer.convert_tokens_to_ids(answer_tokens)) # remove space prepending space token
  ```
  
  But got following error:
  ```
  ---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  <ipython-input-18-4bf253125151> in <module>
        7 attention_mask = encoding["attention_mask"]
        8 
  ----> 9 outputs = model(input_ids, attention_mask=attention_mask)
       10 start_logits = outputs.start_logits
       11 end_logits = outputs.end_logits
  
  ~\Documents\env\lib\site-packages\tensorflow\python\keras\engine\base_layer.py in __call__(self, *args, **kwargs)
      983 
      984         with ops.enable_auto_cast_variables(self._compute_dtype_object):
  --> 985           outputs = call_fn(inputs, *args, **kwargs)
      986 
      987         if self._activity_regularizer:
  
  ~\Documents\env\lib\site-packages\transformers\modeling_tf_longformer.py in call(self, inputs, attention_mask, global_attention_mask, token_type_ids, position_ids, inputs_embeds, output_attentions, output_hidden_states, return_dict, start_positions, end_positions, training)
     1492                 # put global attention on all tokens until `config.sep_token_id` is reached
     1493                 sep_token_indices = tf.where(input_ids == self.config.sep_token_id)
  -> 1494                 global_attention_mask = _compute_global_attention_mask(shape_list(input_ids), sep_token_indices)
     1495 
     1496         outputs = self.longformer(
  
  ~\Documents\env\lib\site-packages\transformers\modeling_tf_utils.py in shape_list(x)
      924         :obj:`List[int]`: The shape of the tensor as a list.
      925     """
  --> 926     static = x.shape.as_list()
      927     dynamic = tf.shape(x)
      928     return [dynamic[i] if s is None else s for i, s in enumerate(static)]
  
  AttributeError: 'torch.Size' object has no attribute 'as_list'
  ```