{"action":"opened","number":14305,"pull_request":{"url":"https://api.github.com/repos/pytorch/pytorch/pulls/14305","id":232840794,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyODQwNzk0","html_url":"https://github.com/pytorch/pytorch/pull/14305","diff_url":"https://github.com/pytorch/pytorch/pull/14305.diff","patch_url":"https://github.com/pytorch/pytorch/pull/14305.patch","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/14305","number":14305,"state":"open","locked":false,"title":"Add (partial) autodiff support for nll_loss","user":{"login":"asuhan","id":246815,"node_id":"MDQ6VXNlcjI0NjgxNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/246815?v=4","gravatar_id":"","url":"https://api.github.com/users/asuhan","html_url":"https://github.com/asuhan","followers_url":"https://api.github.com/users/asuhan/followers","following_url":"https://api.github.com/users/asuhan/following{/other_user}","gists_url":"https://api.github.com/users/asuhan/gists{/gist_id}","starred_url":"https://api.github.com/users/asuhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asuhan/subscriptions","organizations_url":"https://api.github.com/users/asuhan/orgs","repos_url":"https://api.github.com/users/asuhan/repos","events_url":"https://api.github.com/users/asuhan/events{/privacy}","received_events_url":"https://api.github.com/users/asuhan/received_events","type":"User","site_admin":false},"body":"Not ready yet, need some comments / help with this. It's good enough for https://github.com/pytorch/xla immediate goals (forward + backward trace fusion), but there are at least two issues with it:\r\n\r\n1. If we don't allow it, `test/test_jit.py` fails to cover the change.\r\n2. If we allow the weight to be set, running `test/test_jit.py TestJitGenerated.test_nn_nll_loss` fails with:\r\n\r\n```\r\n======================================================================\r\nERROR: test_nn_nll_loss (__main__.TestJitGenerated)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"test/test_jit.py\", line 10001, in do_test\r\n    fn, f_args_variable, kwargs_variable, no_grad=no_grad)\r\n  File \"test/test_jit.py\", line 9360, in check_against_reference\r\n    outputs_test = self.runAndSaveRNG(func, recording_inputs, kwargs)\r\n  File \"test/test_jit.py\", line 425, in runAndSaveRNG\r\n    results = func(*inputs, **kwargs)\r\n  File \"test/test_jit.py\", line 9298, in script_fn\r\n    self.assertExportImport(CU.the_method.graph, tensors)\r\n  File \"test/test_jit.py\", line 415, in assertExportImport\r\n    self.assertExportImportModule(m, inputs)\r\n  File \"test/test_jit.py\", line 419, in assertExportImportModule\r\n    self.assertEqual(self.runAndSaveRNG(m.forward, inputs),\r\n  File \"test/test_jit.py\", line 425, in runAndSaveRNG\r\n    results = func(*inputs, **kwargs)\r\nRuntimeError: \r\narguments for call are not valid:\r\n  \r\n  for operator aten::nll_loss_backward(Tensor grad_output, Tensor self, Tensor target, Tensor? weight, int reduction, int ignore_index, Tensor total_weight, *, Tensor out) -> Tensor:\r\n  expected a value of type Tensor for argument 'total_weight' but found bool\r\n  <internally-created-node>\r\n  ~ <--- HERE\r\n  \r\n  for operator aten::nll_loss_backward(Tensor grad_output, Tensor self, Tensor target, Tensor? weight, int reduction, int ignore_index, Tensor total_weight) -> Tensor:\r\n  expected a value of type Tensor for argument 'total_weight' but found bool\r\n  <internally-created-node>\r\n  ~ <--- HERE\r\nfor call at:\r\n<internally-created-node>\r\n~ <--- HERE\r\n```\r\n","created_at":"2018-11-22T02:08:47Z","updated_at":"2018-11-22T02:08:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pytorch/pytorch/pulls/14305/commits","review_comments_url":"https://api.github.com/repos/pytorch/pytorch/pulls/14305/comments","review_comment_url":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/14305/comments","statuses_url":"https://api.github.com/repos/pytorch/pytorch/statuses/642ae9dd08ad6aaf3dd2ef0d7fc5109159bce4e9","head":{"label":"asuhan:autodiff_nll_loss","ref":"autodiff_nll_loss","sha":"642ae9dd08ad6aaf3dd2ef0d7fc5109159bce4e9","user":{"login":"asuhan","id":246815,"node_id":"MDQ6VXNlcjI0NjgxNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/246815?v=4","gravatar_id":"","url":"https://api.github.com/users/asuhan","html_url":"https://github.com/asuhan","followers_url":"https://api.github.com/users/asuhan/followers","following_url":"https://api.github.com/users/asuhan/following{/other_user}","gists_url":"https://api.github.com/users/asuhan/gists{/gist_id}","starred_url":"https://api.github.com/users/asuhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asuhan/subscriptions","organizations_url":"https://api.github.com/users/asuhan/orgs","repos_url":"https://api.github.com/users/asuhan/repos","events_url":"https://api.github.com/users/asuhan/events{/privacy}","received_events_url":"https://api.github.com/users/asuhan/received_events","type":"User","site_admin":false},"repo":{"id":137104419,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxMDQ0MTk=","name":"pytorch","full_name":"asuhan/pytorch","private":false,"owner":{"login":"asuhan","id":246815,"node_id":"MDQ6VXNlcjI0NjgxNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/246815?v=4","gravatar_id":"","url":"https://api.github.com/users/asuhan","html_url":"https://github.com/asuhan","followers_url":"https://api.github.com/users/asuhan/followers","following_url":"https://api.github.com/users/asuhan/following{/other_user}","gists_url":"https://api.github.com/users/asuhan/gists{/gist_id}","starred_url":"https://api.github.com/users/asuhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asuhan/subscriptions","organizations_url":"https://api.github.com/users/asuhan/orgs","repos_url":"https://api.github.com/users/asuhan/repos","events_url":"https://api.github.com/users/asuhan/events{/privacy}","received_events_url":"https://api.github.com/users/asuhan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/asuhan/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":true,"url":"https://api.github.com/repos/asuhan/pytorch","forks_url":"https://api.github.com/repos/asuhan/pytorch/forks","keys_url":"https://api.github.com/repos/asuhan/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asuhan/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asuhan/pytorch/teams","hooks_url":"https://api.github.com/repos/asuhan/pytorch/hooks","issue_events_url":"https://api.github.com/repos/asuhan/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/asuhan/pytorch/events","assignees_url":"https://api.github.com/repos/asuhan/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/asuhan/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/asuhan/pytorch/tags","blobs_url":"https://api.github.com/repos/asuhan/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asuhan/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asuhan/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/asuhan/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asuhan/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/asuhan/pytorch/languages","stargazers_url":"https://api.github.com/repos/asuhan/pytorch/stargazers","contributors_url":"https://api.github.com/repos/asuhan/pytorch/contributors","subscribers_url":"https://api.github.com/repos/asuhan/pytorch/subscribers","subscription_url":"https://api.github.com/repos/asuhan/pytorch/subscription","commits_url":"https://api.github.com/repos/asuhan/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/asuhan/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/asuhan/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/asuhan/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/asuhan/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/asuhan/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asuhan/pytorch/merges","archive_url":"https://api.github.com/repos/asuhan/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asuhan/pytorch/downloads","issues_url":"https://api.github.com/repos/asuhan/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/asuhan/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/asuhan/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/asuhan/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asuhan/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/asuhan/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/asuhan/pytorch/deployments","created_at":"2018-06-12T17:14:18Z","updated_at":"2018-08-03T08:09:57Z","pushed_at":"2018-11-22T01:14:49Z","git_url":"git://github.com/asuhan/pytorch.git","ssh_url":"git@github.com:asuhan/pytorch.git","clone_url":"https://github.com/asuhan/pytorch.git","svn_url":"https://github.com/asuhan/pytorch","homepage":"http://pytorch.org","size":86818,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytorch:master","ref":"master","sha":"b149456645a2e9e70bdac8aa9e6d47681442c200","user":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"repo":{"id":65600975,"node_id":"MDEwOlJlcG9zaXRvcnk2NTYwMDk3NQ==","name":"pytorch","full_name":"pytorch/pytorch","private":false,"owner":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pytorch/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":false,"url":"https://api.github.com/repos/pytorch/pytorch","forks_url":"https://api.github.com/repos/pytorch/pytorch/forks","keys_url":"https://api.github.com/repos/pytorch/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytorch/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytorch/pytorch/teams","hooks_url":"https://api.github.com/repos/pytorch/pytorch/hooks","issue_events_url":"https://api.github.com/repos/pytorch/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/pytorch/pytorch/events","assignees_url":"https://api.github.com/repos/pytorch/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/pytorch/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/pytorch/pytorch/tags","blobs_url":"https://api.github.com/repos/pytorch/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytorch/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytorch/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytorch/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytorch/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/pytorch/pytorch/languages","stargazers_url":"https://api.github.com/repos/pytorch/pytorch/stargazers","contributors_url":"https://api.github.com/repos/pytorch/pytorch/contributors","subscribers_url":"https://api.github.com/repos/pytorch/pytorch/subscribers","subscription_url":"https://api.github.com/repos/pytorch/pytorch/subscription","commits_url":"https://api.github.com/repos/pytorch/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytorch/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytorch/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytorch/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytorch/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/pytorch/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytorch/pytorch/merges","archive_url":"https://api.github.com/repos/pytorch/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytorch/pytorch/downloads","issues_url":"https://api.github.com/repos/pytorch/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/pytorch/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/pytorch/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/pytorch/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytorch/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/pytorch/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/pytorch/pytorch/deployments","created_at":"2016-08-13T05:26:41Z","updated_at":"2018-11-22T01:50:24Z","pushed_at":"2018-11-22T01:48:52Z","git_url":"git://github.com/pytorch/pytorch.git","ssh_url":"git@github.com:pytorch/pytorch.git","clone_url":"https://github.com/pytorch/pytorch.git","svn_url":"https://github.com/pytorch/pytorch","homepage":"http://pytorch.org","size":89426,"stargazers_count":21508,"watchers_count":21508,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5135,"mirror_url":null,"archived":false,"open_issues_count":2177,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5135,"open_issues":2177,"watchers":21508,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/14305"},"html":{"href":"https://github.com/pytorch/pytorch/pull/14305"},"issue":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/14305"},"comments":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/14305/comments"},"review_comments":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/14305/comments"},"review_comment":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/14305/commits"},"statuses":{"href":"https://api.github.com/repos/pytorch/pytorch/statuses/642ae9dd08ad6aaf3dd2ef0d7fc5109159bce4e9"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":22,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"asuhan"}}