AttributeError: 'Tensor' object has no attribute 'size'
This is the model that I have defined:

```
input_layer = keras.layers.Input(shape = (attention_mask.shape[1],), dtype='int64')
bert = DistilBertModel.from_pretrained("distilbert-base-cased")(input_layer)
bert = bert[0][:,0,:]              
# bert = keras.layers.Dense(units=10, activation='relu')(bert)
classifier = keras.layers.Dense(units=1, activation='sigmoid')(bert)
model = keras.models.Model(inputs=input_layer, outputs=classifier)
model.summary()
```

This is the error I am getting.
```
AttributeError                            Traceback (most recent call last)

<ipython-input-12-6d7e88036056> in <module>()
      1 input_layer = keras.layers.Input(shape = (attention_mask.shape[1],), dtype='int64')
----> 2 bert = DistilBertModel.from_pretrained("distilbert-base-cased")(input_layer)
      3 bert = bert[0][:,0,:]
      4 # bert = keras.layers.Dense(units=10, activation='relu')(bert)
      5 classifier = keras.layers.Dense(units=1, activation='sigmoid')(bert)

1 frames

/usr/local/lib/python3.6/dist-packages/transformers/modeling_distilbert.py in forward(self, input_ids, attention_mask, head_mask, inputs_embeds)
    449             raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
    450         elif input_ids is not None:
--> 451             input_shape = input_ids.size()
    452         elif inputs_embeds is not None:
    453             input_shape = inputs_embeds.size()[:-1]

AttributeError: 'Tensor' object has no attribute 'size'
```

The same code works fine when distilbert is replaced with bert. What to do in this case.
You are using TF. Did you mean to use `TFDistilBertModel` instead of `DistilBertModel`?<|||||>@BramVanroy got it. Thanks.<|||||>I wonder if it would be possible to know in advance whether a model supports TF or pyTorch, or both... and throw an exception accordingly? 