Unable to format dataset to CUDA Tensors
MEMBER
Hi ! You can get CUDA tensors with

```python
dataset.set_format("torch", columns=columns, device="cuda")
```

Indeed `set_format` passes the `**kwargs` to `torch.tensor`
2021-01-21T15:41:55Z
https://github.com/huggingface/datasets/issues/1762#issuecomment-764731705
https://api.github.com/repos/huggingface/datasets/issues/1762
MDEyOklzc3VlQ29tbWVudDc2NDczMTcwNQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/764731705/reactions
2021-01-21T15:41:55Z
https://api.github.com/repos/huggingface/datasets/issues/comments/764731705
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
Hi @lhoestq,

Thanks a lot. Is this true for all format types?

As in, for 'torch', I can have `**kwargs` to `torch.tensor` and for 'tf' those args are passed to `tf.Tensor`, and the same for 'numpy' and 'pandas'?
2021-01-22T01:26:40Z
https://github.com/huggingface/datasets/issues/1762#issuecomment-765051353
https://api.github.com/repos/huggingface/datasets/issues/1762
MDEyOklzc3VlQ29tbWVudDc2NTA1MTM1Mw==
https://api.github.com/repos/huggingface/datasets/issues/comments/765051353/reactions
2021-01-22T01:26:40Z
https://api.github.com/repos/huggingface/datasets/issues/comments/765051353
https://avatars.githubusercontent.com/u/29076344?v=4
https://api.github.com/users/gchhablani/events{/privacy}
https://api.github.com/users/gchhablani/followers
https://api.github.com/users/gchhablani/following{/other_user}
https://api.github.com/users/gchhablani/gists{/gist_id}
https://github.com/gchhablani
gchhablani
MDQ6VXNlcjI5MDc2MzQ0
https://api.github.com/users/gchhablani/orgs
https://api.github.com/users/gchhablani/received_events
https://api.github.com/users/gchhablani/repos
https://api.github.com/users/gchhablani/starred{/owner}{/repo}
https://api.github.com/users/gchhablani/subscriptions
User
https://api.github.com/users/gchhablani
public
MEMBER
Yes the keywords arguments are passed to the convert function like `np.array`, `torch.tensor` or `tensorflow.ragged.constant`.
We don't support the kwargs for pandas on the other hand.
2021-01-22T09:38:09Z
https://github.com/huggingface/datasets/issues/1762#issuecomment-765274047
https://api.github.com/repos/huggingface/datasets/issues/1762
MDEyOklzc3VlQ29tbWVudDc2NTI3NDA0Nw==
https://api.github.com/repos/huggingface/datasets/issues/comments/765274047/reactions
2021-01-22T09:38:09Z
https://api.github.com/repos/huggingface/datasets/issues/comments/765274047
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
Thanks @lhoestq,
Would it be okay if I added this to the docs and made a PR?
2021-01-22T14:51:57Z
https://github.com/huggingface/datasets/issues/1762#issuecomment-765456795
https://api.github.com/repos/huggingface/datasets/issues/1762
MDEyOklzc3VlQ29tbWVudDc2NTQ1Njc5NQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/765456795/reactions
2021-01-22T14:51:57Z
https://api.github.com/repos/huggingface/datasets/issues/comments/765456795
https://avatars.githubusercontent.com/u/29076344?v=4
https://api.github.com/users/gchhablani/events{/privacy}
https://api.github.com/users/gchhablani/followers
https://api.github.com/users/gchhablani/following{/other_user}
https://api.github.com/users/gchhablani/gists{/gist_id}
https://github.com/gchhablani
gchhablani
MDQ6VXNlcjI5MDc2MzQ0
https://api.github.com/users/gchhablani/orgs
https://api.github.com/users/gchhablani/received_events
https://api.github.com/users/gchhablani/repos
https://api.github.com/users/gchhablani/starred{/owner}{/repo}
https://api.github.com/users/gchhablani/subscriptions
User
https://api.github.com/users/gchhablani
public
MEMBER
Sure ! Feel free to open a PR to improve the documentation :) 
2021-01-22T14:53:46Z
https://github.com/huggingface/datasets/issues/1762#issuecomment-765458199
https://api.github.com/repos/huggingface/datasets/issues/1762
MDEyOklzc3VlQ29tbWVudDc2NTQ1ODE5OQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/765458199/reactions
2021-01-22T14:53:46Z
https://api.github.com/repos/huggingface/datasets/issues/comments/765458199
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
Closing this issue as it has been resolved.
2021-02-02T07:13:22Z
https://github.com/huggingface/datasets/issues/1762#issuecomment-771421401
https://api.github.com/repos/huggingface/datasets/issues/1762
MDEyOklzc3VlQ29tbWVudDc3MTQyMTQwMQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/771421401/reactions
2021-02-02T07:13:22Z
https://api.github.com/repos/huggingface/datasets/issues/comments/771421401
https://avatars.githubusercontent.com/u/29076344?v=4
https://api.github.com/users/gchhablani/events{/privacy}
https://api.github.com/users/gchhablani/followers
https://api.github.com/users/gchhablani/following{/other_user}
https://api.github.com/users/gchhablani/gists{/gist_id}
https://github.com/gchhablani
gchhablani
MDQ6VXNlcjI5MDc2MzQ0
https://api.github.com/users/gchhablani/orgs
https://api.github.com/users/gchhablani/received_events
https://api.github.com/users/gchhablani/repos
https://api.github.com/users/gchhablani/starred{/owner}{/repo}
https://api.github.com/users/gchhablani/subscriptions
User
https://api.github.com/users/gchhablani
public
Hi,

I came across this [link](https://huggingface.co/docs/datasets/torch_tensorflow.html) where the docs show show to convert a dataset to a particular format. I see that there is an option to convert it to tensors, but I don't see any option to convert it to CUDA tensors.

I tried this, but Dataset doesn't support assignment:
```
  columns=['input_ids', 'token_type_ids', 'attention_mask', 'start_positions','end_positions']

        samples.set_format(type='torch', columns = columns)
        for column in columns:
            samples[column].to(torch.device(self.config.device))
```
There should be an option to do so, or if there is already a way to do this, please let me know.

Thanks,
Gunjan