Only put tensors on a device
Fix Trainer when users have inputs containing non-tensor values.
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5223?src=pr&el=h1) Report
> Merging [#5223](https://codecov.io/gh/huggingface/transformers/pull/5223?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/c01480bba3b2f0bd8516679476235f4701c21b3b&el=desc) will **decrease** coverage by `0.03%`.
> The diff coverage is `60.00%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5223/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5223?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #5223      +/-   ##
==========================================
- Coverage   77.98%   77.95%   -0.04%     
==========================================
  Files         138      138              
  Lines       23839    23841       +2     
==========================================
- Hits        18592    18586       -6     
- Misses       5247     5255       +8     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5223?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/5223/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `39.62% <60.00%> (+0.04%)` | :arrow_up: |
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5223/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `79.51% <0.00%> (-1.39%)` | :arrow_down: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5223/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `76.42% <0.00%> (-0.39%)` | :arrow_down: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5223/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `85.86% <0.00%> (-0.30%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5223?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5223?src=pr&el=footer). Last update [c01480b...10ff478](https://codecov.io/gh/huggingface/transformers/pull/5223?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
