AttributeError: 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'new_ones'
I have environment with following

```
torch=1.7.1+cpu
tensorflow=2.2.0
transformers=4.2.2
Python=3.6.12 
```

and I am using below command 

```
input_ids = tokenizer.encode('accident', return_tensors='tf')
greedy_output = model.generate(input_ids, max_length=50)
print("Output:\n" + 100 * '-')
```

but I get the error below


```
  File "/home/anaconda3/envs/myenv/lib/python3.6/site-packages/transformers/generation_utils.py", line 368, in _prepare_attention_mask_for_generation
    return input_ids.new_ones(input_ids.shape)

AttributeError: 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'new_ones'
```

Earlier, until October, the same was working perfectly. May I ask help which error or conflict I am making./?

Did you fix this, and if so, how? I'm having the same problem and nothing's working for me so far.

**EDIT**: Fixed it, I was using `tf` tensors with a (PyTorch) `AutoModel` instead of a `TFAutoModel`.