{"action":"created","comment":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/comments/74254335","id":74254335,"diff_hunk":"@@ -995,6 +997,87 @@ def test_gpu(self):\n         self.check_backward(cuda.to_gpu(self.x), cuda.to_gpu(self.gy))\n \n \n+@testing.parameterize(*testing.product_dict(\n+    [\n+        {'left_const': False, 'right_const': False},\n+        {'left_const': True, 'right_const': False},\n+        {'left_const': False, 'right_const': True},\n+    ], [\n+        {'dtype': numpy.float16},\n+        {'dtype': numpy.float32},\n+        {'dtype': numpy.float64},\n+    ]\n+))\n+class TestMatMulVarVar(unittest.TestCase):\n+\n+    def setUp(self):\n+        self.x = numpy.random.uniform(-1, 1, (3, 2)).astype(self.dtype)\n+        self.y = numpy.random.uniform(-1, 1, (2, 4)).astype(self.dtype)\n+        self.gz = numpy.random.uniform(-1, 1, (3, 4)).astype(self.dtype)\n+\n+    def check_forward(self, x_data, y_data):\n+        if self.left_const:\n+            x = x_data\n+        else:\n+            x = chainer.Variable(x_data)\n+        if self.right_const:\n+            y = y_data\n+        else:\n+            y = chainer.Variable(y_data)\n+        z = operator.matmul(x, y)\n+        if self.dtype == numpy.float16:\n+            options = {'atol': 1e-3, 'rtol': 1e-3}\n+        else:\n+            options = {'atol': 1e-7, 'rtol': 1e-7}\n+        testing.assert_allclose(\n+            operator.matmul(self.x, self.y), z.data, **options)\n+\n+    @unittest.skipUnless(sys.version_info >= (3, 5),\n+                         'Only for Python3.5 or higher')\n+    @condition.retry(3)\n+    def test_forward_cpu(self):\n+        self.check_forward(self.x, self.y)\n+\n+    @unittest.skipUnless(sys.version_info >= (3, 5),\n+                         'Only for Python3.5 or higher')\n+    @attr.gpu\n+    @condition.retry(3)\n+    def test_forward_gpu(self):\n+        self.check_forward(cuda.to_gpu(self.x), cuda.to_gpu(self.y))\n+\n+    def check_backward(self, x_data, y_data, z_grad):\n+        if self.right_const:\n+            op = lambda x: operator.matmul(x, y_data)\n+            data = x_data,\n+        elif self.left_const:\n+            op = lambda y: operator.matmul(x_data, y)\n+            data = y_data,\n+        else:\n+            op = operator.matmul\n+            data = x_data, y_data\n+\n+        if self.dtype == numpy.float16:\n+            options = {'eps': 1e-2, 'atol': 1e-2, 'rtol': 1e-1}\n+        else:\n+            options = {'atol': 1e-4, 'rtol': 1e-4}\n+        gradient_check.check_backward(\n+            op, data, z_grad, **options)\n+\n+    @unittest.skipUnless(sys.version_info[0] >= 3 and sys.version_info[1] >= 5,\n+                         'Only for Python3.5 or higher')\n+    def test_backward_cpu(self):\n+        self.check_backward(self.x, self.y, self.gz)\n+\n+    @attr.gpu\n+    @unittest.skipUnless(\n+        (sys.version_info.major >= 4 or","path":"tests/chainer_tests/functions_tests/math_tests/test_basic_math.py","position":83,"original_position":83,"commit_id":"b0ea0a779608f703093c30f4efa8a11ca9b54e0c","original_commit_id":"b0ea0a779608f703093c30f4efa8a11ca9b54e0c","user":{"login":"unnonouno","id":740680,"avatar_url":"https://avatars.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":"fix it","created_at":"2016-08-10T14:26:01Z","updated_at":"2016-08-10T14:26:01Z","html_url":"https://github.com/pfnet/chainer/pull/1138#discussion_r74254335","pull_request_url":"https://api.github.com/repos/pfnet/chainer/pulls/1138","_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments/74254335"},"html":{"href":"https://github.com/pfnet/chainer/pull/1138#discussion_r74254335"},"pull_request":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1138"}}},"pull_request":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/1138","id":66883937,"html_url":"https://github.com/pfnet/chainer/pull/1138","diff_url":"https://github.com/pfnet/chainer/pull/1138.diff","patch_url":"https://github.com/pfnet/chainer/pull/1138.patch","issue_url":"https://api.github.com/repos/pfnet/chainer/issues/1138","number":1138,"state":"open","locked":false,"title":"Implement matmul operator to Variable","user":{"login":"okuta","id":7133388,"avatar_url":"https://avatars.githubusercontent.com/u/7133388?v=3","gravatar_id":"","url":"https://api.github.com/users/okuta","html_url":"https://github.com/okuta","followers_url":"https://api.github.com/users/okuta/followers","following_url":"https://api.github.com/users/okuta/following{/other_user}","gists_url":"https://api.github.com/users/okuta/gists{/gist_id}","starred_url":"https://api.github.com/users/okuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okuta/subscriptions","organizations_url":"https://api.github.com/users/okuta/orgs","repos_url":"https://api.github.com/users/okuta/repos","events_url":"https://api.github.com/users/okuta/events{/privacy}","received_events_url":"https://api.github.com/users/okuta/received_events","type":"User","site_admin":false},"body":"Rel #666.","created_at":"2016-04-18T16:36:43Z","updated_at":"2016-08-10T14:26:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"324bdf9310f4aaf1922329866bb33bf2cef17e19","assignee":{"login":"unnonouno","id":740680,"avatar_url":"https://avatars.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},"assignees":[{"login":"unnonouno","id":740680,"avatar_url":"https://avatars.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},{"login":"muupan","id":815970,"avatar_url":"https://avatars.githubusercontent.com/u/815970?v=3","gravatar_id":"","url":"https://api.github.com/users/muupan","html_url":"https://github.com/muupan","followers_url":"https://api.github.com/users/muupan/followers","following_url":"https://api.github.com/users/muupan/following{/other_user}","gists_url":"https://api.github.com/users/muupan/gists{/gist_id}","starred_url":"https://api.github.com/users/muupan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muupan/subscriptions","organizations_url":"https://api.github.com/users/muupan/orgs","repos_url":"https://api.github.com/users/muupan/repos","events_url":"https://api.github.com/users/muupan/events{/privacy}","received_events_url":"https://api.github.com/users/muupan/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pfnet/chainer/pulls/1138/commits","review_comments_url":"https://api.github.com/repos/pfnet/chainer/pulls/1138/comments","review_comment_url":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pfnet/chainer/issues/1138/comments","statuses_url":"https://api.github.com/repos/pfnet/chainer/statuses/b0ea0a779608f703093c30f4efa8a11ca9b54e0c","head":{"label":"pfnet:impl-matmul","ref":"impl-matmul","sha":"b0ea0a779608f703093c30f4efa8a11ca9b54e0c","user":{"login":"pfnet","id":9739572,"avatar_url":"https://avatars.githubusercontent.com/u/9739572?v=3","gravatar_id":"","url":"https://api.github.com/users/pfnet","html_url":"https://github.com/pfnet","followers_url":"https://api.github.com/users/pfnet/followers","following_url":"https://api.github.com/users/pfnet/following{/other_user}","gists_url":"https://api.github.com/users/pfnet/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet/subscriptions","organizations_url":"https://api.github.com/users/pfnet/orgs","repos_url":"https://api.github.com/users/pfnet/repos","events_url":"https://api.github.com/users/pfnet/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet/received_events","type":"Organization","site_admin":false},"repo":{"id":36914478,"name":"chainer","full_name":"pfnet/chainer","owner":{"login":"pfnet","id":9739572,"avatar_url":"https://avatars.githubusercontent.com/u/9739572?v=3","gravatar_id":"","url":"https://api.github.com/users/pfnet","html_url":"https://github.com/pfnet","followers_url":"https://api.github.com/users/pfnet/followers","following_url":"https://api.github.com/users/pfnet/following{/other_user}","gists_url":"https://api.github.com/users/pfnet/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet/subscriptions","organizations_url":"https://api.github.com/users/pfnet/orgs","repos_url":"https://api.github.com/users/pfnet/repos","events_url":"https://api.github.com/users/pfnet/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pfnet/chainer","description":"A flexible framework of neural networks for deep learning","fork":false,"url":"https://api.github.com/repos/pfnet/chainer","forks_url":"https://api.github.com/repos/pfnet/chainer/forks","keys_url":"https://api.github.com/repos/pfnet/chainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pfnet/chainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pfnet/chainer/teams","hooks_url":"https://api.github.com/repos/pfnet/chainer/hooks","issue_events_url":"https://api.github.com/repos/pfnet/chainer/issues/events{/number}","events_url":"https://api.github.com/repos/pfnet/chainer/events","assignees_url":"https://api.github.com/repos/pfnet/chainer/assignees{/user}","branches_url":"https://api.github.com/repos/pfnet/chainer/branches{/branch}","tags_url":"https://api.github.com/repos/pfnet/chainer/tags","blobs_url":"https://api.github.com/repos/pfnet/chainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pfnet/chainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pfnet/chainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/pfnet/chainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pfnet/chainer/statuses/{sha}","languages_url":"https://api.github.com/repos/pfnet/chainer/languages","stargazers_url":"https://api.github.com/repos/pfnet/chainer/stargazers","contributors_url":"https://api.github.com/repos/pfnet/chainer/contributors","subscribers_url":"https://api.github.com/repos/pfnet/chainer/subscribers","subscription_url":"https://api.github.com/repos/pfnet/chainer/subscription","commits_url":"https://api.github.com/repos/pfnet/chainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/pfnet/chainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/pfnet/chainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/pfnet/chainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/pfnet/chainer/contents/{+path}","compare_url":"https://api.github.com/repos/pfnet/chainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pfnet/chainer/merges","archive_url":"https://api.github.com/repos/pfnet/chainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pfnet/chainer/downloads","issues_url":"https://api.github.com/repos/pfnet/chainer/issues{/number}","pulls_url":"https://api.github.com/repos/pfnet/chainer/pulls{/number}","milestones_url":"https://api.github.com/repos/pfnet/chainer/milestones{/number}","notifications_url":"https://api.github.com/repos/pfnet/chainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pfnet/chainer/labels{/name}","releases_url":"https://api.github.com/repos/pfnet/chainer/releases{/id}","deployments_url":"https://api.github.com/repos/pfnet/chainer/deployments","created_at":"2015-06-05T05:50:37Z","updated_at":"2016-08-10T12:02:51Z","pushed_at":"2016-08-10T11:46:49Z","git_url":"git://github.com/pfnet/chainer.git","ssh_url":"git@github.com:pfnet/chainer.git","clone_url":"https://github.com/pfnet/chainer.git","svn_url":"https://github.com/pfnet/chainer","homepage":"http://chainer.org","size":29898,"stargazers_count":1571,"watchers_count":1571,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":377,"mirror_url":null,"open_issues_count":199,"forks":377,"open_issues":199,"watchers":1571,"default_branch":"master"}},"base":{"label":"pfnet:master","ref":"master","sha":"3c2f20493f03b509d8a0e1991a5872b8eb4558e4","user":{"login":"pfnet","id":9739572,"avatar_url":"https://avatars.githubusercontent.com/u/9739572?v=3","gravatar_id":"","url":"https://api.github.com/users/pfnet","html_url":"https://github.com/pfnet","followers_url":"https://api.github.com/users/pfnet/followers","following_url":"https://api.github.com/users/pfnet/following{/other_user}","gists_url":"https://api.github.com/users/pfnet/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet/subscriptions","organizations_url":"https://api.github.com/users/pfnet/orgs","repos_url":"https://api.github.com/users/pfnet/repos","events_url":"https://api.github.com/users/pfnet/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet/received_events","type":"Organization","site_admin":false},"repo":{"id":36914478,"name":"chainer","full_name":"pfnet/chainer","owner":{"login":"pfnet","id":9739572,"avatar_url":"https://avatars.githubusercontent.com/u/9739572?v=3","gravatar_id":"","url":"https://api.github.com/users/pfnet","html_url":"https://github.com/pfnet","followers_url":"https://api.github.com/users/pfnet/followers","following_url":"https://api.github.com/users/pfnet/following{/other_user}","gists_url":"https://api.github.com/users/pfnet/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet/subscriptions","organizations_url":"https://api.github.com/users/pfnet/orgs","repos_url":"https://api.github.com/users/pfnet/repos","events_url":"https://api.github.com/users/pfnet/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pfnet/chainer","description":"A flexible framework of neural networks for deep learning","fork":false,"url":"https://api.github.com/repos/pfnet/chainer","forks_url":"https://api.github.com/repos/pfnet/chainer/forks","keys_url":"https://api.github.com/repos/pfnet/chainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pfnet/chainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pfnet/chainer/teams","hooks_url":"https://api.github.com/repos/pfnet/chainer/hooks","issue_events_url":"https://api.github.com/repos/pfnet/chainer/issues/events{/number}","events_url":"https://api.github.com/repos/pfnet/chainer/events","assignees_url":"https://api.github.com/repos/pfnet/chainer/assignees{/user}","branches_url":"https://api.github.com/repos/pfnet/chainer/branches{/branch}","tags_url":"https://api.github.com/repos/pfnet/chainer/tags","blobs_url":"https://api.github.com/repos/pfnet/chainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pfnet/chainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pfnet/chainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/pfnet/chainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pfnet/chainer/statuses/{sha}","languages_url":"https://api.github.com/repos/pfnet/chainer/languages","stargazers_url":"https://api.github.com/repos/pfnet/chainer/stargazers","contributors_url":"https://api.github.com/repos/pfnet/chainer/contributors","subscribers_url":"https://api.github.com/repos/pfnet/chainer/subscribers","subscription_url":"https://api.github.com/repos/pfnet/chainer/subscription","commits_url":"https://api.github.com/repos/pfnet/chainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/pfnet/chainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/pfnet/chainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/pfnet/chainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/pfnet/chainer/contents/{+path}","compare_url":"https://api.github.com/repos/pfnet/chainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pfnet/chainer/merges","archive_url":"https://api.github.com/repos/pfnet/chainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pfnet/chainer/downloads","issues_url":"https://api.github.com/repos/pfnet/chainer/issues{/number}","pulls_url":"https://api.github.com/repos/pfnet/chainer/pulls{/number}","milestones_url":"https://api.github.com/repos/pfnet/chainer/milestones{/number}","notifications_url":"https://api.github.com/repos/pfnet/chainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pfnet/chainer/labels{/name}","releases_url":"https://api.github.com/repos/pfnet/chainer/releases{/id}","deployments_url":"https://api.github.com/repos/pfnet/chainer/deployments","created_at":"2015-06-05T05:50:37Z","updated_at":"2016-08-10T12:02:51Z","pushed_at":"2016-08-10T11:46:49Z","git_url":"git://github.com/pfnet/chainer.git","ssh_url":"git@github.com:pfnet/chainer.git","clone_url":"https://github.com/pfnet/chainer.git","svn_url":"https://github.com/pfnet/chainer","homepage":"http://chainer.org","size":29898,"stargazers_count":1571,"watchers_count":1571,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":377,"mirror_url":null,"open_issues_count":199,"forks":377,"open_issues":199,"watchers":1571,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1138"},"html":{"href":"https://github.com/pfnet/chainer/pull/1138"},"issue":{"href":"https://api.github.com/repos/pfnet/chainer/issues/1138"},"comments":{"href":"https://api.github.com/repos/pfnet/chainer/issues/1138/comments"},"review_comments":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1138/comments"},"review_comment":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1138/commits"},"statuses":{"href":"https://api.github.com/repos/pfnet/chainer/statuses/b0ea0a779608f703093c30f4efa8a11ca9b54e0c"}}}}
{"actor":{"display_login":"unnonouno"}}