{"action":"created","comment":{"url":"https://api.github.com/repos/cupy/cupy/pulls/comments/126286095","pull_request_review_id":48760176,"id":126286095,"diff_hunk":"@@ -0,0 +1,171 @@\n+try:\n+    import scipy.sparse\n+    _scipy_available = True\n+except ImportError:\n+    _scipy_available = False\n+\n+import cupy\n+from cupy import cusparse\n+from cupy.sparse import compressed\n+\n+\n+class csc_matrix(compressed._compressed_sparse_matrix):\n+\n+    \"\"\"Compressed Sparse Column matrix.\n+\n+    Now it has only one initializer format below:\n+\n+    ``csc_matrix((data, indices, indptr))``\n+        All ``data``, ``indices`` and ``indptr`` are one-dimenaional\n+        :class:`cupy.ndarray`.\n+\n+    Args:\n+        arg1: Arguments for the initializer.\n+        shape (tuple): Shape of a matrix. Its length must be two.\n+        dtype: Data type. It must be an argument of :class:`numpy.dtype`.\n+        copy (bool): If ``True``, copies of given data are always used.\n+\n+    .. see::\n+       :class:`scipy.sparse.csc_matrix`\n+\n+    \"\"\"\n+\n+    format = 'csc'\n+\n+    def get(self, stream=None):\n+        \"\"\"Returns a copy of the array on host memory.\n+\n+        .. warn::\n+           You need to install SciPy to use this method.\n+\n+        Args:\n+            stream (cupy.cuda.Stream): CUDA stream object. If it is given, the\n+                copy runs asynchronously. Otherwise, the copy is synchronous.\n+\n+        Returns:\n+            scipy.sparse.csc_matrix: Copy of the array on host memory.\n+\n+        \"\"\"\n+        if not _scipy_available:\n+            raise RuntimeError('scipy is not available')\n+        data = self.data.get(stream)\n+        indices = self.indices.get(stream)\n+        indptr = self.indptr.get(stream)\n+        return scipy.sparse.csc_matrix(\n+            (data, indices, indptr), shape=self._shape)\n+\n+    def _swap(self, x, y):\n+        return (y, x)\n+\n+    # TODO(unno): Implement __getitem__\n+    # TODO(unno): Implement argmax\n+    # TODO(unno): Implement argmin\n+    # TODO(unno): Implement check_format\n+    # TODO(unno): Implement diagonal\n+    # TODO(unno): Implement dot\n+    # TODO(unno): Implement eliminate_zeros\n+\n+    # TODO(unno): Implement max\n+    # TODO(unno): Implement maximum\n+    # TODO(unno): Implement min\n+    # TODO(unno): Implement minimum\n+    # TODO(unno): Implement multiply\n+    # TODO(unno): Implement prune\n+    # TODO(unno): Implement reshape\n+\n+    def sort_indices(self):\n+        \"\"\"Sort the indices of the matrix in place.\"\"\"\n+        cusparse.cscsort(self)\n+\n+    # TODO(unno): Implement sum_duplicates\n+\n+    def toarray(self, order=None, out=None):\n+        \"\"\"Returns a dense matrix representing the same value.\n+\n+        Args:\n+            order: Not supported.\n+            out: Not supported.\n+\n+        Returns:\n+            cupy.ndarray: Dense array representing the same value.\n+\n+        .. seealso:: :func:`cupy.sparse.csc_array.toarray`\n+\n+        \"\"\"\n+        return self.T.toarray().T\n+\n+    # TODO(unno): Implement tobsr\n+\n+    def tocoo(self, copy=False):\n+        \"\"\"Convert the matrix to COOdinate format.\n+\n+        Args:\n+            copy (bool): If ``False``, it shares data arrays as much as\n+                possible.\n+\n+        Returns:\n+            cupy.sparse.coo_matrix: Converte matrix.\n+\n+        \"\"\"\n+        return self.T.tocoo(copy).T\n+\n+    def tocsc(self, copy=False):\n+        \"\"\"Convert the matrix to Compressed Sparse Column format.\n+\n+        Args:\n+            copy (bool): If ``False``, it shares data arrays as much as\n+                possible.\n+\n+        Returns:\n+            cupy.sparse.csc_matrix: Converte matrix.\n+\n+        \"\"\"\n+        if copy:\n+            return self.copy()\n+        else:\n+            return self\n+\n+    def tocsr(self, copy=False):\n+        \"\"\"Convert the matrix to Compressed Sparse Row format.\n+\n+        Args:\n+            copy (bool): If ``False``, it shares data arrays as much as\n+                possible.\n+\n+        Returns:\n+            cupy.sparse.csr_matrix: Converte matrix.\n+\n+        \"\"\"\n+        return self.T.tocsc(copy).T\n+\n+    # TODO(unno): Implement todia\n+    # TODO(unno): Implement todok\n+    # TODO(unno): Implement tolil\n+\n+    def transpose(self, axes=None, copy=False):\n+        \"\"\"Returns a transpose matrix.\n+\n+        Args:\n+            axes: This option is not supported.\n+            copy (bool): If ``True``, a returned matrix shares no data.\n+                Otherwise, it shared data arrays as much as possible.\n+","path":"cupy/sparse/csc.py","position":149,"original_position":152,"commit_id":"18d81932b24a9da20f16186569ec55b3974b09f9","original_commit_id":"beecdac3622277b5ebe39668131c3a02d8973e81","user":{"login":"unnonouno","id":740680,"avatar_url":"https://avatars2.githubusercontent.com/u/740680?v=3","gravatar_id":"","url":"https://api.github.com/users/unnonouno","html_url":"https://github.com/unnonouno","followers_url":"https://api.github.com/users/unnonouno/followers","following_url":"https://api.github.com/users/unnonouno/following{/other_user}","gists_url":"https://api.github.com/users/unnonouno/gists{/gist_id}","starred_url":"https://api.github.com/users/unnonouno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unnonouno/subscriptions","organizations_url":"https://api.github.com/users/unnonouno/orgs","repos_url":"https://api.github.com/users/unnonouno/repos","events_url":"https://api.github.com/users/unnonouno/events{/privacy}","received_events_url":"https://api.github.com/users/unnonouno/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-07-08T17:01:40Z","updated_at":"2017-07-08T17:01:40Z","html_url":"https://github.com/cupy/cupy/pull/226#discussion_r126286095","pull_request_url":"https://api.github.com/repos/cupy/cupy/pulls/226","_links":{"self":{"href":"https://api.github.com/repos/cupy/cupy/pulls/comments/126286095"},"html":{"href":"https://github.com/cupy/cupy/pull/226#discussion_r126286095"},"pull_request":{"href":"https://api.github.com/repos/cupy/cupy/pulls/226"}}},"pull_request":{"url":"https://api.github.com/repos/cupy/cupy/pulls/226","id":127975999,"html_url":"https://github.com/cupy/cupy/pull/226","diff_url":"https://github.com/cupy/cupy/pull/226.diff","patch_url":"https://github.com/cupy/cupy/pull/226.patch","issue_url":"https://api.github.com/repos/cupy/cupy/issues/226","number":226,"state":"open","locked":false,"title":"CSR and CSC","user":{"login":"unnonouno","id":740680,"avatar_url":"https://avatars2.githubusercontent.com/u/740680?v=3","gravatar_id":"","url":"https://api.github.com/users/unnonouno","html_url":"https://github.com/unnonouno","followers_url":"https://api.github.com/users/unnonouno/followers","following_url":"https://api.github.com/users/unnonouno/following{/other_user}","gists_url":"https://api.github.com/users/unnonouno/gists{/gist_id}","starred_url":"https://api.github.com/users/unnonouno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unnonouno/subscriptions","organizations_url":"https://api.github.com/users/unnonouno/orgs","repos_url":"https://api.github.com/users/unnonouno/repos","events_url":"https://api.github.com/users/unnonouno/events{/privacy}","received_events_url":"https://api.github.com/users/unnonouno/received_events","type":"User","site_admin":false},"body":"I implemented minimum methods for CSR matrix and CSC matrix.\r\nrelated to #36 ","created_at":"2017-06-28T17:21:24Z","updated_at":"2017-07-08T17:01:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaa5159377b04339d16f0b23d20d52a19ff2d1f2","assignee":{"login":"takagi","id":1224375,"avatar_url":"https://avatars0.githubusercontent.com/u/1224375?v=3","gravatar_id":"","url":"https://api.github.com/users/takagi","html_url":"https://github.com/takagi","followers_url":"https://api.github.com/users/takagi/followers","following_url":"https://api.github.com/users/takagi/following{/other_user}","gists_url":"https://api.github.com/users/takagi/gists{/gist_id}","starred_url":"https://api.github.com/users/takagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takagi/subscriptions","organizations_url":"https://api.github.com/users/takagi/orgs","repos_url":"https://api.github.com/users/takagi/repos","events_url":"https://api.github.com/users/takagi/events{/privacy}","received_events_url":"https://api.github.com/users/takagi/received_events","type":"User","site_admin":false},"assignees":[{"login":"takagi","id":1224375,"avatar_url":"https://avatars0.githubusercontent.com/u/1224375?v=3","gravatar_id":"","url":"https://api.github.com/users/takagi","html_url":"https://github.com/takagi","followers_url":"https://api.github.com/users/takagi/followers","following_url":"https://api.github.com/users/takagi/following{/other_user}","gists_url":"https://api.github.com/users/takagi/gists{/gist_id}","starred_url":"https://api.github.com/users/takagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takagi/subscriptions","organizations_url":"https://api.github.com/users/takagi/orgs","repos_url":"https://api.github.com/users/takagi/repos","events_url":"https://api.github.com/users/takagi/events{/privacy}","received_events_url":"https://api.github.com/users/takagi/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/cupy/cupy/pulls/226/commits","review_comments_url":"https://api.github.com/repos/cupy/cupy/pulls/226/comments","review_comment_url":"https://api.github.com/repos/cupy/cupy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cupy/cupy/issues/226/comments","statuses_url":"https://api.github.com/repos/cupy/cupy/statuses/18d81932b24a9da20f16186569ec55b3974b09f9","head":{"label":"unnonouno:csr","ref":"csr","sha":"18d81932b24a9da20f16186569ec55b3974b09f9","user":{"login":"unnonouno","id":740680,"avatar_url":"https://avatars2.githubusercontent.com/u/740680?v=3","gravatar_id":"","url":"https://api.github.com/users/unnonouno","html_url":"https://github.com/unnonouno","followers_url":"https://api.github.com/users/unnonouno/followers","following_url":"https://api.github.com/users/unnonouno/following{/other_user}","gists_url":"https://api.github.com/users/unnonouno/gists{/gist_id}","starred_url":"https://api.github.com/users/unnonouno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unnonouno/subscriptions","organizations_url":"https://api.github.com/users/unnonouno/orgs","repos_url":"https://api.github.com/users/unnonouno/repos","events_url":"https://api.github.com/users/unnonouno/events{/privacy}","received_events_url":"https://api.github.com/users/unnonouno/received_events","type":"User","site_admin":false},"repo":{"id":95103764,"name":"cupy","full_name":"unnonouno/cupy","owner":{"login":"unnonouno","id":740680,"avatar_url":"https://avatars2.githubusercontent.com/u/740680?v=3","gravatar_id":"","url":"https://api.github.com/users/unnonouno","html_url":"https://github.com/unnonouno","followers_url":"https://api.github.com/users/unnonouno/followers","following_url":"https://api.github.com/users/unnonouno/following{/other_user}","gists_url":"https://api.github.com/users/unnonouno/gists{/gist_id}","starred_url":"https://api.github.com/users/unnonouno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unnonouno/subscriptions","organizations_url":"https://api.github.com/users/unnonouno/orgs","repos_url":"https://api.github.com/users/unnonouno/repos","events_url":"https://api.github.com/users/unnonouno/events{/privacy}","received_events_url":"https://api.github.com/users/unnonouno/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/unnonouno/cupy","description":"NumPy-like API accelerated with CUDA","fork":true,"url":"https://api.github.com/repos/unnonouno/cupy","forks_url":"https://api.github.com/repos/unnonouno/cupy/forks","keys_url":"https://api.github.com/repos/unnonouno/cupy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unnonouno/cupy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unnonouno/cupy/teams","hooks_url":"https://api.github.com/repos/unnonouno/cupy/hooks","issue_events_url":"https://api.github.com/repos/unnonouno/cupy/issues/events{/number}","events_url":"https://api.github.com/repos/unnonouno/cupy/events","assignees_url":"https://api.github.com/repos/unnonouno/cupy/assignees{/user}","branches_url":"https://api.github.com/repos/unnonouno/cupy/branches{/branch}","tags_url":"https://api.github.com/repos/unnonouno/cupy/tags","blobs_url":"https://api.github.com/repos/unnonouno/cupy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unnonouno/cupy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unnonouno/cupy/git/refs{/sha}","trees_url":"https://api.github.com/repos/unnonouno/cupy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unnonouno/cupy/statuses/{sha}","languages_url":"https://api.github.com/repos/unnonouno/cupy/languages","stargazers_url":"https://api.github.com/repos/unnonouno/cupy/stargazers","contributors_url":"https://api.github.com/repos/unnonouno/cupy/contributors","subscribers_url":"https://api.github.com/repos/unnonouno/cupy/subscribers","subscription_url":"https://api.github.com/repos/unnonouno/cupy/subscription","commits_url":"https://api.github.com/repos/unnonouno/cupy/commits{/sha}","git_commits_url":"https://api.github.com/repos/unnonouno/cupy/git/commits{/sha}","comments_url":"https://api.github.com/repos/unnonouno/cupy/comments{/number}","issue_comment_url":"https://api.github.com/repos/unnonouno/cupy/issues/comments{/number}","contents_url":"https://api.github.com/repos/unnonouno/cupy/contents/{+path}","compare_url":"https://api.github.com/repos/unnonouno/cupy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unnonouno/cupy/merges","archive_url":"https://api.github.com/repos/unnonouno/cupy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unnonouno/cupy/downloads","issues_url":"https://api.github.com/repos/unnonouno/cupy/issues{/number}","pulls_url":"https://api.github.com/repos/unnonouno/cupy/pulls{/number}","milestones_url":"https://api.github.com/repos/unnonouno/cupy/milestones{/number}","notifications_url":"https://api.github.com/repos/unnonouno/cupy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unnonouno/cupy/labels{/name}","releases_url":"https://api.github.com/repos/unnonouno/cupy/releases{/id}","deployments_url":"https://api.github.com/repos/unnonouno/cupy/deployments","created_at":"2017-06-22T10:26:18Z","updated_at":"2017-06-22T10:26:20Z","pushed_at":"2017-07-08T17:00:41Z","git_url":"git://github.com/unnonouno/cupy.git","ssh_url":"git@github.com:unnonouno/cupy.git","clone_url":"https://github.com/unnonouno/cupy.git","svn_url":"https://github.com/unnonouno/cupy","homepage":"https://cupy.chainer.org","size":10948,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cupy:master","ref":"master","sha":"0cbc248dd605dbf6feaba278801b61a64c541a7f","user":{"login":"cupy","id":23187665,"avatar_url":"https://avatars1.githubusercontent.com/u/23187665?v=3","gravatar_id":"","url":"https://api.github.com/users/cupy","html_url":"https://github.com/cupy","followers_url":"https://api.github.com/users/cupy/followers","following_url":"https://api.github.com/users/cupy/following{/other_user}","gists_url":"https://api.github.com/users/cupy/gists{/gist_id}","starred_url":"https://api.github.com/users/cupy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cupy/subscriptions","organizations_url":"https://api.github.com/users/cupy/orgs","repos_url":"https://api.github.com/users/cupy/repos","events_url":"https://api.github.com/users/cupy/events{/privacy}","received_events_url":"https://api.github.com/users/cupy/received_events","type":"Organization","site_admin":false},"repo":{"id":72523920,"name":"cupy","full_name":"cupy/cupy","owner":{"login":"cupy","id":23187665,"avatar_url":"https://avatars1.githubusercontent.com/u/23187665?v=3","gravatar_id":"","url":"https://api.github.com/users/cupy","html_url":"https://github.com/cupy","followers_url":"https://api.github.com/users/cupy/followers","following_url":"https://api.github.com/users/cupy/following{/other_user}","gists_url":"https://api.github.com/users/cupy/gists{/gist_id}","starred_url":"https://api.github.com/users/cupy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cupy/subscriptions","organizations_url":"https://api.github.com/users/cupy/orgs","repos_url":"https://api.github.com/users/cupy/repos","events_url":"https://api.github.com/users/cupy/events{/privacy}","received_events_url":"https://api.github.com/users/cupy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cupy/cupy","description":"NumPy-like API accelerated with CUDA","fork":false,"url":"https://api.github.com/repos/cupy/cupy","forks_url":"https://api.github.com/repos/cupy/cupy/forks","keys_url":"https://api.github.com/repos/cupy/cupy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cupy/cupy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cupy/cupy/teams","hooks_url":"https://api.github.com/repos/cupy/cupy/hooks","issue_events_url":"https://api.github.com/repos/cupy/cupy/issues/events{/number}","events_url":"https://api.github.com/repos/cupy/cupy/events","assignees_url":"https://api.github.com/repos/cupy/cupy/assignees{/user}","branches_url":"https://api.github.com/repos/cupy/cupy/branches{/branch}","tags_url":"https://api.github.com/repos/cupy/cupy/tags","blobs_url":"https://api.github.com/repos/cupy/cupy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cupy/cupy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cupy/cupy/git/refs{/sha}","trees_url":"https://api.github.com/repos/cupy/cupy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cupy/cupy/statuses/{sha}","languages_url":"https://api.github.com/repos/cupy/cupy/languages","stargazers_url":"https://api.github.com/repos/cupy/cupy/stargazers","contributors_url":"https://api.github.com/repos/cupy/cupy/contributors","subscribers_url":"https://api.github.com/repos/cupy/cupy/subscribers","subscription_url":"https://api.github.com/repos/cupy/cupy/subscription","commits_url":"https://api.github.com/repos/cupy/cupy/commits{/sha}","git_commits_url":"https://api.github.com/repos/cupy/cupy/git/commits{/sha}","comments_url":"https://api.github.com/repos/cupy/cupy/comments{/number}","issue_comment_url":"https://api.github.com/repos/cupy/cupy/issues/comments{/number}","contents_url":"https://api.github.com/repos/cupy/cupy/contents/{+path}","compare_url":"https://api.github.com/repos/cupy/cupy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cupy/cupy/merges","archive_url":"https://api.github.com/repos/cupy/cupy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cupy/cupy/downloads","issues_url":"https://api.github.com/repos/cupy/cupy/issues{/number}","pulls_url":"https://api.github.com/repos/cupy/cupy/pulls{/number}","milestones_url":"https://api.github.com/repos/cupy/cupy/milestones{/number}","notifications_url":"https://api.github.com/repos/cupy/cupy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cupy/cupy/labels{/name}","releases_url":"https://api.github.com/repos/cupy/cupy/releases{/id}","deployments_url":"https://api.github.com/repos/cupy/cupy/deployments","created_at":"2016-11-01T09:54:45Z","updated_at":"2017-07-08T10:39:24Z","pushed_at":"2017-07-08T17:00:43Z","git_url":"git://github.com/cupy/cupy.git","ssh_url":"git@github.com:cupy/cupy.git","clone_url":"https://github.com/cupy/cupy.git","svn_url":"https://github.com/cupy/cupy","homepage":"https://cupy.chainer.org","size":10930,"stargazers_count":330,"watchers_count":330,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":75,"forks":46,"open_issues":75,"watchers":330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cupy/cupy/pulls/226"},"html":{"href":"https://github.com/cupy/cupy/pull/226"},"issue":{"href":"https://api.github.com/repos/cupy/cupy/issues/226"},"comments":{"href":"https://api.github.com/repos/cupy/cupy/issues/226/comments"},"review_comments":{"href":"https://api.github.com/repos/cupy/cupy/pulls/226/comments"},"review_comment":{"href":"https://api.github.com/repos/cupy/cupy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cupy/cupy/pulls/226/commits"},"statuses":{"href":"https://api.github.com/repos/cupy/cupy/statuses/18d81932b24a9da20f16186569ec55b3974b09f9"}}}}
{"actor":{"display_login":"unnonouno"}}