How to convert  torch.utils.data.Dataset to datasets.arrow_dataset.Dataset?
{'login': 'CindyTing', 'id': 35062414, 'node_id': 'MDQ6VXNlcjM1MDYyNDE0', 'avatar_url': 'https://avatars.githubusercontent.com/u/35062414?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/CindyTing', 'html_url': 'https://github.com/CindyTing', 'followers_url': 'https://api.github.com/users/CindyTing/followers', 'following_url': 'https://api.github.com/users/CindyTing/following{/other_user}', 'gists_url': 'https://api.github.com/users/CindyTing/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/CindyTing/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/CindyTing/subscriptions', 'organizations_url': 'https://api.github.com/users/CindyTing/orgs', 'repos_url': 'https://api.github.com/users/CindyTing/repos', 'events_url': 'https://api.github.com/users/CindyTing/events{/privacy}', 'received_events_url': 'https://api.github.com/users/CindyTing/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892871, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODcx', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/enhancement', 'name': 'enhancement', 'color': 'a2eeef', 'default': True, 'description': 'New feature or request'}]
[]
Hi,
I use torch.utils.data.Dataset to define my own data, but I need to use the 'map' function of datasets.arrow_dataset.Dataset later, so I hope to convert torch.utils.data.Dataset to datasets.arrow_dataset.Dataset.

Here is an example.
```
from torch.utils.data import Dataset
from datasets.arrow_dataset import Dataset as HFDataset

class ADataset(Dataset):
    def __init__(self, data): 
        super().__init__()
        self.data = data
    def __getitem__(self, index):
        return self.data[index]
    def __len__(self):
        return self.len
class MDataset():
    def __init__(self, tokenizer: AutoTokenizer, data_args, training_args):
        self.train_dataset = ADataset(data_args)
        self.tokenizer = tokenizer
        self.data_args = data_args

        self.train_dataset = self.train_dataset.map(
            self.process_function,
            batched=True,
            remove_columns=column_names,
            load_from_cache_file=True,
            desc="Running tokenizer on train dataset",
             )
    def process_function(self, examples):
        sentences = [" ".join(sample[0][3]) for sample in examples]

        tokenized = self.tokenizer(
            sentences,
            max_length=self.max_seq_len,
            padding=self.padding, 
            truncation=True)
```
But it would raise an ERROR, AttributeError: 'ADataset' object has no attribute 'map'.

so how to convert  torch.utils.data.Dataset to datasets.arrow_dataset.Dataset?

Thanks in advance!





{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3540/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}