{"action":"created","issue":{"url":"https://api.github.com/repos/GRAAL-Research/pytoune/issues/11","repository_url":"https://api.github.com/repos/GRAAL-Research/pytoune","labels_url":"https://api.github.com/repos/GRAAL-Research/pytoune/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/GRAAL-Research/pytoune/issues/11/comments","events_url":"https://api.github.com/repos/GRAAL-Research/pytoune/issues/11/events","html_url":"https://github.com/GRAAL-Research/pytoune/issues/11","id":339214968,"node_id":"MDU6SXNzdWUzMzkyMTQ5Njg=","number":11,"title":"multiple GPUs when initialize","user":{"login":"chuong98","id":15174756,"node_id":"MDQ6VXNlcjE1MTc0NzU2","avatar_url":"https://avatars1.githubusercontent.com/u/15174756?v=4","gravatar_id":"","url":"https://api.github.com/users/chuong98","html_url":"https://github.com/chuong98","followers_url":"https://api.github.com/users/chuong98/followers","following_url":"https://api.github.com/users/chuong98/following{/other_user}","gists_url":"https://api.github.com/users/chuong98/gists{/gist_id}","starred_url":"https://api.github.com/users/chuong98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chuong98/subscriptions","organizations_url":"https://api.github.com/users/chuong98/orgs","repos_url":"https://api.github.com/users/chuong98/repos","events_url":"https://api.github.com/users/chuong98/events{/privacy}","received_events_url":"https://api.github.com/users/chuong98/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-08T10:31:10Z","updated_at":"2018-08-07T21:27:10Z","closed_at":null,"author_association":"NONE","body":"Hi, thanks for the package. Does the package support multiple -GPUs mode.\r\nSome thing like this when initializing the Model.__init__()\r\n\r\n```\r\ndef __init__(self, model, optimizer, loss_function, metrics=[]):\r\n        self.model = model\r\n        self.optimizer = optimizer\r\n        self.loss_function = loss_function\r\n        self.metrics = list(map(get_metric, metrics))\r\n        self.metrics_names = [metric.__name__ for metric in self.metrics]\r\n        self.device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\r\n        print(f'Using GPU {self.device}')\r\n\r\n        #Transfer model to GPUs model\r\n        nGPUs =   torch.cuda.device_count()\r\n        if  nGPUs> 1:\r\n            print(f\"==============Using {nGPUs} GPUs ==============\")\r\n            self.model = torch.nn.DataParallel(self.model)\r\n        self.model = self.model.to(self.device)\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GRAAL-Research/pytoune/issues/comments/411208286","html_url":"https://github.com/GRAAL-Research/pytoune/issues/11#issuecomment-411208286","issue_url":"https://api.github.com/repos/GRAAL-Research/pytoune/issues/11","id":411208286,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTIwODI4Ng==","user":{"login":"freud14","id":1090012,"node_id":"MDQ6VXNlcjEwOTAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1090012?v=4","gravatar_id":"","url":"https://api.github.com/users/freud14","html_url":"https://github.com/freud14","followers_url":"https://api.github.com/users/freud14/followers","following_url":"https://api.github.com/users/freud14/following{/other_user}","gists_url":"https://api.github.com/users/freud14/gists{/gist_id}","starred_url":"https://api.github.com/users/freud14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freud14/subscriptions","organizations_url":"https://api.github.com/users/freud14/orgs","repos_url":"https://api.github.com/users/freud14/repos","events_url":"https://api.github.com/users/freud14/events{/privacy}","received_events_url":"https://api.github.com/users/freud14/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T21:27:10Z","updated_at":"2018-08-07T21:27:10Z","author_association":"COLLABORATOR","body":"Hi, have you taken the time to test the commit?"}}
{"actor":{"display_login":"freud14"}}