{"action":"created","comment":{"url":"https://api.github.com/repos/mila-udem/blocks/pulls/comments/33446483","id":33446483,"diff_hunk":"@@ -143,29 +141,18 @@ def compute_contexts(self, inputs):\n \n         Returns\n         -------\n-        A {name: :class:`numpy.ndarray`} dictionary of contexts ordered\n-        like `self.context_names`.\n-\n-        \"\"\"\n-        contexts = self.context_computer(*[inputs[var]\n-                                           for var in self.inputs])\n-        return OrderedDict(equizip(self.context_names, contexts))\n-\n-    def compute_initial_states(self, contexts):\n-        \"\"\"Computes initial states.\n-\n-        Parameters\n-        ----------\n-        contexts : dict\n-            A {name: :class:`numpy.ndarray`} dictionary of contexts.\n-\n-        Returns\n-        -------\n-        A {name: :class:`numpy.ndarray`} dictionary of states ordered like\n+        A tuple containing a {name: :class:`numpy.ndarray`} dictionary of\n+        contexts ordered like `self.context_names` and a\n+        {name: :class:`numpy.ndarray`} dictionary of states ordered like\n         `self.state_names`.\n \n         \"\"\"\n-        return self.initial_state_computer(*list(contexts.values()))\n+        outputs = self.initial_state_and_context_computer(\n+            *[inputs[var] for var in self.inputs])\n+        contexts = OrderedDict((n, outputs.pop(n)) for n in self.context_names)\n+        self.beam_size = outputs.pop('beam_size')","path":"blocks/search.py","position":115,"original_position":115,"commit_id":"4d201cff9e13c15964b7b33ba94f4dcef85d4f60","original_commit_id":"4d201cff9e13c15964b7b33ba94f4dcef85d4f60","user":{"login":"rizar","id":654434,"avatar_url":"https://avatars.githubusercontent.com/u/654434?v=3","gravatar_id":"","url":"https://api.github.com/users/rizar","html_url":"https://github.com/rizar","followers_url":"https://api.github.com/users/rizar/followers","following_url":"https://api.github.com/users/rizar/following{/other_user}","gists_url":"https://api.github.com/users/rizar/gists{/gist_id}","starred_url":"https://api.github.com/users/rizar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizar/subscriptions","organizations_url":"https://api.github.com/users/rizar/orgs","repos_url":"https://api.github.com/users/rizar/repos","events_url":"https://api.github.com/users/rizar/events{/privacy}","received_events_url":"https://api.github.com/users/rizar/received_events","type":"User","site_admin":false},"body":"Please do not use class attributes for returning results from a method. You can add `beam_size` to the return statement.","created_at":"2015-06-29T09:18:15Z","updated_at":"2015-06-29T09:18:15Z","html_url":"https://github.com/mila-udem/blocks/pull/732#discussion_r33446483","pull_request_url":"https://api.github.com/repos/mila-udem/blocks/pulls/732","_links":{"self":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/comments/33446483"},"html":{"href":"https://github.com/mila-udem/blocks/pull/732#discussion_r33446483"},"pull_request":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/732"}}},"pull_request":{"url":"https://api.github.com/repos/mila-udem/blocks/pulls/732","id":38579919,"html_url":"https://github.com/mila-udem/blocks/pull/732","diff_url":"https://github.com/mila-udem/blocks/pull/732.diff","patch_url":"https://github.com/mila-udem/blocks/pull/732.patch","issue_url":"https://api.github.com/repos/mila-udem/blocks/issues/732","number":732,"state":"open","locked":false,"title":"WIP: Extract initial states from cg graph.","user":{"login":"Thrandis","id":10479248,"avatar_url":"https://avatars.githubusercontent.com/u/10479248?v=3","gravatar_id":"","url":"https://api.github.com/users/Thrandis","html_url":"https://github.com/Thrandis","followers_url":"https://api.github.com/users/Thrandis/followers","following_url":"https://api.github.com/users/Thrandis/following{/other_user}","gists_url":"https://api.github.com/users/Thrandis/gists{/gist_id}","starred_url":"https://api.github.com/users/Thrandis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thrandis/subscriptions","organizations_url":"https://api.github.com/users/Thrandis/orgs","repos_url":"https://api.github.com/users/Thrandis/repos","events_url":"https://api.github.com/users/Thrandis/events{/privacy}","received_events_url":"https://api.github.com/users/Thrandis/received_events","type":"User","site_admin":false},"body":"Will fix #719 and #500","created_at":"2015-06-25T18:47:58Z","updated_at":"2015-06-29T09:18:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"daaad6ea72873125a51489216896c8e7052b1426","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mila-udem/blocks/pulls/732/commits","review_comments_url":"https://api.github.com/repos/mila-udem/blocks/pulls/732/comments","review_comment_url":"https://api.github.com/repos/mila-udem/blocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mila-udem/blocks/issues/732/comments","statuses_url":"https://api.github.com/repos/mila-udem/blocks/statuses/4d201cff9e13c15964b7b33ba94f4dcef85d4f60","head":{"label":"Thrandis:ccw","ref":"ccw","sha":"4d201cff9e13c15964b7b33ba94f4dcef85d4f60","user":{"login":"Thrandis","id":10479248,"avatar_url":"https://avatars.githubusercontent.com/u/10479248?v=3","gravatar_id":"","url":"https://api.github.com/users/Thrandis","html_url":"https://github.com/Thrandis","followers_url":"https://api.github.com/users/Thrandis/followers","following_url":"https://api.github.com/users/Thrandis/following{/other_user}","gists_url":"https://api.github.com/users/Thrandis/gists{/gist_id}","starred_url":"https://api.github.com/users/Thrandis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thrandis/subscriptions","organizations_url":"https://api.github.com/users/Thrandis/orgs","repos_url":"https://api.github.com/users/Thrandis/repos","events_url":"https://api.github.com/users/Thrandis/events{/privacy}","received_events_url":"https://api.github.com/users/Thrandis/received_events","type":"User","site_admin":false},"repo":{"id":32275787,"name":"blocks","full_name":"Thrandis/blocks","owner":{"login":"Thrandis","id":10479248,"avatar_url":"https://avatars.githubusercontent.com/u/10479248?v=3","gravatar_id":"","url":"https://api.github.com/users/Thrandis","html_url":"https://github.com/Thrandis","followers_url":"https://api.github.com/users/Thrandis/followers","following_url":"https://api.github.com/users/Thrandis/following{/other_user}","gists_url":"https://api.github.com/users/Thrandis/gists{/gist_id}","starred_url":"https://api.github.com/users/Thrandis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thrandis/subscriptions","organizations_url":"https://api.github.com/users/Thrandis/orgs","repos_url":"https://api.github.com/users/Thrandis/repos","events_url":"https://api.github.com/users/Thrandis/events{/privacy}","received_events_url":"https://api.github.com/users/Thrandis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Thrandis/blocks","description":"A Theano framework for building and training neural networks","fork":true,"url":"https://api.github.com/repos/Thrandis/blocks","forks_url":"https://api.github.com/repos/Thrandis/blocks/forks","keys_url":"https://api.github.com/repos/Thrandis/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Thrandis/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Thrandis/blocks/teams","hooks_url":"https://api.github.com/repos/Thrandis/blocks/hooks","issue_events_url":"https://api.github.com/repos/Thrandis/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/Thrandis/blocks/events","assignees_url":"https://api.github.com/repos/Thrandis/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/Thrandis/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/Thrandis/blocks/tags","blobs_url":"https://api.github.com/repos/Thrandis/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Thrandis/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Thrandis/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Thrandis/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Thrandis/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/Thrandis/blocks/languages","stargazers_url":"https://api.github.com/repos/Thrandis/blocks/stargazers","contributors_url":"https://api.github.com/repos/Thrandis/blocks/contributors","subscribers_url":"https://api.github.com/repos/Thrandis/blocks/subscribers","subscription_url":"https://api.github.com/repos/Thrandis/blocks/subscription","commits_url":"https://api.github.com/repos/Thrandis/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Thrandis/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Thrandis/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Thrandis/blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Thrandis/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/Thrandis/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Thrandis/blocks/merges","archive_url":"https://api.github.com/repos/Thrandis/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Thrandis/blocks/downloads","issues_url":"https://api.github.com/repos/Thrandis/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/Thrandis/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/Thrandis/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/Thrandis/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Thrandis/blocks/labels{/name}","releases_url":"https://api.github.com/repos/Thrandis/blocks/releases{/id}","created_at":"2015-03-15T18:07:02Z","updated_at":"2015-04-29T19:22:26Z","pushed_at":"2015-06-26T20:59:38Z","git_url":"git://github.com/Thrandis/blocks.git","ssh_url":"git@github.com:Thrandis/blocks.git","clone_url":"https://github.com/Thrandis/blocks.git","svn_url":"https://github.com/Thrandis/blocks","homepage":"","size":10128,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mila-udem:master","ref":"master","sha":"cbeb6e1b7746f4a564c8c3ba70904f07bd3fc266","user":{"login":"mila-udem","id":11724251,"avatar_url":"https://avatars.githubusercontent.com/u/11724251?v=3","gravatar_id":"","url":"https://api.github.com/users/mila-udem","html_url":"https://github.com/mila-udem","followers_url":"https://api.github.com/users/mila-udem/followers","following_url":"https://api.github.com/users/mila-udem/following{/other_user}","gists_url":"https://api.github.com/users/mila-udem/gists{/gist_id}","starred_url":"https://api.github.com/users/mila-udem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mila-udem/subscriptions","organizations_url":"https://api.github.com/users/mila-udem/orgs","repos_url":"https://api.github.com/users/mila-udem/repos","events_url":"https://api.github.com/users/mila-udem/events{/privacy}","received_events_url":"https://api.github.com/users/mila-udem/received_events","type":"Organization","site_admin":false},"repo":{"id":24829371,"name":"blocks","full_name":"mila-udem/blocks","owner":{"login":"mila-udem","id":11724251,"avatar_url":"https://avatars.githubusercontent.com/u/11724251?v=3","gravatar_id":"","url":"https://api.github.com/users/mila-udem","html_url":"https://github.com/mila-udem","followers_url":"https://api.github.com/users/mila-udem/followers","following_url":"https://api.github.com/users/mila-udem/following{/other_user}","gists_url":"https://api.github.com/users/mila-udem/gists{/gist_id}","starred_url":"https://api.github.com/users/mila-udem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mila-udem/subscriptions","organizations_url":"https://api.github.com/users/mila-udem/orgs","repos_url":"https://api.github.com/users/mila-udem/repos","events_url":"https://api.github.com/users/mila-udem/events{/privacy}","received_events_url":"https://api.github.com/users/mila-udem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mila-udem/blocks","description":"A Theano framework for building and training neural networks","fork":false,"url":"https://api.github.com/repos/mila-udem/blocks","forks_url":"https://api.github.com/repos/mila-udem/blocks/forks","keys_url":"https://api.github.com/repos/mila-udem/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mila-udem/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mila-udem/blocks/teams","hooks_url":"https://api.github.com/repos/mila-udem/blocks/hooks","issue_events_url":"https://api.github.com/repos/mila-udem/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/mila-udem/blocks/events","assignees_url":"https://api.github.com/repos/mila-udem/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/mila-udem/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/mila-udem/blocks/tags","blobs_url":"https://api.github.com/repos/mila-udem/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mila-udem/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mila-udem/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/mila-udem/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mila-udem/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/mila-udem/blocks/languages","stargazers_url":"https://api.github.com/repos/mila-udem/blocks/stargazers","contributors_url":"https://api.github.com/repos/mila-udem/blocks/contributors","subscribers_url":"https://api.github.com/repos/mila-udem/blocks/subscribers","subscription_url":"https://api.github.com/repos/mila-udem/blocks/subscription","commits_url":"https://api.github.com/repos/mila-udem/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/mila-udem/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/mila-udem/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/mila-udem/blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/mila-udem/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/mila-udem/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mila-udem/blocks/merges","archive_url":"https://api.github.com/repos/mila-udem/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mila-udem/blocks/downloads","issues_url":"https://api.github.com/repos/mila-udem/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/mila-udem/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/mila-udem/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/mila-udem/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mila-udem/blocks/labels{/name}","releases_url":"https://api.github.com/repos/mila-udem/blocks/releases{/id}","created_at":"2014-10-06T00:08:32Z","updated_at":"2015-06-29T06:25:25Z","pushed_at":"2015-06-29T09:04:42Z","git_url":"git://github.com/mila-udem/blocks.git","ssh_url":"git@github.com:mila-udem/blocks.git","clone_url":"https://github.com/mila-udem/blocks.git","svn_url":"https://github.com/mila-udem/blocks","homepage":"","size":29647,"stargazers_count":325,"watchers_count":325,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":104,"forks":92,"open_issues":104,"watchers":325,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/732"},"html":{"href":"https://github.com/mila-udem/blocks/pull/732"},"issue":{"href":"https://api.github.com/repos/mila-udem/blocks/issues/732"},"comments":{"href":"https://api.github.com/repos/mila-udem/blocks/issues/732/comments"},"review_comments":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/732/comments"},"review_comment":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/732/commits"},"statuses":{"href":"https://api.github.com/repos/mila-udem/blocks/statuses/4d201cff9e13c15964b7b33ba94f4dcef85d4f60"}}}}