{"action":"created","comment":{"url":"https://api.github.com/repos/mila-udem/blocks/pulls/comments/66808983","id":66808983,"diff_hunk":"@@ -168,28 +168,31 @@ def recurrent_apply(brick, application, application_call,\n                     logger.warning(\"unknown input {}\".format(value) +\n                                    unknown_scan_input)\n \n-            # Ensure that all initial states are available.\n-            initial_states = brick.initial_states(batch_size, as_dict=True,\n-                                                  *args, **kwargs)\n-            for state_name in application.states:\n-                dim = brick.get_dim(state_name)\n-                if state_name in kwargs:\n-                    if isinstance(kwargs[state_name], NdarrayInitialization):\n-                        kwargs[state_name] = tensor.alloc(\n-                            kwargs[state_name].generate(brick.rng, (1, dim)),\n-                            batch_size, dim)\n-                    elif isinstance(kwargs[state_name], Application):\n-                        kwargs[state_name] = (\n-                            kwargs[state_name](state_name, batch_size,\n-                                               *args, **kwargs))\n-                else:\n-                    try:\n-                        kwargs[state_name] = initial_states[state_name]\n-                    except KeyError:\n-                        raise KeyError(\n-                            \"no initial state for '{}' of the brick {}\".format(\n-                                state_name, brick.name))\n-            states_given = dict_subset(kwargs, application.states)\n+            if len(application.states):\n+                # Ensure that all initial states are available.\n+                initial_states = brick.initial_states(batch_size, as_dict=True,\n+                                                      *args, **kwargs)\n+                for state_name in application.states:","path":"blocks/bricks/recurrent/base.py","position":30,"original_position":30,"commit_id":"2fdba23baaeb8a30aad6b5f615807da1614b35d5","original_commit_id":"2fdba23baaeb8a30aad6b5f615807da1614b35d5","user":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"body":"I suggest to add the line before \r\n```python\r\nelse:\r\n    initial_states = OrderedDict()\r\n```","created_at":"2016-06-13T15:10:15Z","updated_at":"2016-06-13T15:10:15Z","html_url":"https://github.com/mila-udem/blocks/pull/1113#discussion_r66808983","pull_request_url":"https://api.github.com/repos/mila-udem/blocks/pulls/1113","_links":{"self":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/comments/66808983"},"html":{"href":"https://github.com/mila-udem/blocks/pull/1113#discussion_r66808983"},"pull_request":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/1113"}}},"pull_request":{"url":"https://api.github.com/repos/mila-udem/blocks/pulls/1113","id":72992692,"html_url":"https://github.com/mila-udem/blocks/pull/1113","diff_url":"https://github.com/mila-udem/blocks/pull/1113.diff","patch_url":"https://github.com/mila-udem/blocks/pull/1113.patch","issue_url":"https://api.github.com/repos/mila-udem/blocks/issues/1113","number":1113,"state":"open","locked":false,"title":"support recurrent with no states.","user":{"login":"Beronx86","id":9522624,"avatar_url":"https://avatars.githubusercontent.com/u/9522624?v=3","gravatar_id":"","url":"https://api.github.com/users/Beronx86","html_url":"https://github.com/Beronx86","followers_url":"https://api.github.com/users/Beronx86/followers","following_url":"https://api.github.com/users/Beronx86/following{/other_user}","gists_url":"https://api.github.com/users/Beronx86/gists{/gist_id}","starred_url":"https://api.github.com/users/Beronx86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Beronx86/subscriptions","organizations_url":"https://api.github.com/users/Beronx86/orgs","repos_url":"https://api.github.com/users/Beronx86/repos","events_url":"https://api.github.com/users/Beronx86/events{/privacy}","received_events_url":"https://api.github.com/users/Beronx86/received_events","type":"User","site_admin":false},"body":"The recurrent wrapper does not support loop with no states. But this kind of loop may be useful. So I modified the codes.\r\n\r\nFixes #1112","created_at":"2016-06-08T06:29:31Z","updated_at":"2016-06-13T15:10:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a293d1553814ce538783f7612be784bb49a6a180","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mila-udem/blocks/pulls/1113/commits","review_comments_url":"https://api.github.com/repos/mila-udem/blocks/pulls/1113/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/1113/comments","statuses_url":"https://api.github.com/repos/mila-udem/blocks/statuses/2fdba23baaeb8a30aad6b5f615807da1614b35d5","head":{"label":"Beronx86:master","ref":"master","sha":"2fdba23baaeb8a30aad6b5f615807da1614b35d5","user":{"login":"Beronx86","id":9522624,"avatar_url":"https://avatars.githubusercontent.com/u/9522624?v=3","gravatar_id":"","url":"https://api.github.com/users/Beronx86","html_url":"https://github.com/Beronx86","followers_url":"https://api.github.com/users/Beronx86/followers","following_url":"https://api.github.com/users/Beronx86/following{/other_user}","gists_url":"https://api.github.com/users/Beronx86/gists{/gist_id}","starred_url":"https://api.github.com/users/Beronx86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Beronx86/subscriptions","organizations_url":"https://api.github.com/users/Beronx86/orgs","repos_url":"https://api.github.com/users/Beronx86/repos","events_url":"https://api.github.com/users/Beronx86/events{/privacy}","received_events_url":"https://api.github.com/users/Beronx86/received_events","type":"User","site_admin":false},"repo":{"id":60666561,"name":"blocks","full_name":"Beronx86/blocks","owner":{"login":"Beronx86","id":9522624,"avatar_url":"https://avatars.githubusercontent.com/u/9522624?v=3","gravatar_id":"","url":"https://api.github.com/users/Beronx86","html_url":"https://github.com/Beronx86","followers_url":"https://api.github.com/users/Beronx86/followers","following_url":"https://api.github.com/users/Beronx86/following{/other_user}","gists_url":"https://api.github.com/users/Beronx86/gists{/gist_id}","starred_url":"https://api.github.com/users/Beronx86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Beronx86/subscriptions","organizations_url":"https://api.github.com/users/Beronx86/orgs","repos_url":"https://api.github.com/users/Beronx86/repos","events_url":"https://api.github.com/users/Beronx86/events{/privacy}","received_events_url":"https://api.github.com/users/Beronx86/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Beronx86/blocks","description":"A Theano framework for building and training neural networks","fork":true,"url":"https://api.github.com/repos/Beronx86/blocks","forks_url":"https://api.github.com/repos/Beronx86/blocks/forks","keys_url":"https://api.github.com/repos/Beronx86/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Beronx86/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Beronx86/blocks/teams","hooks_url":"https://api.github.com/repos/Beronx86/blocks/hooks","issue_events_url":"https://api.github.com/repos/Beronx86/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/Beronx86/blocks/events","assignees_url":"https://api.github.com/repos/Beronx86/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/Beronx86/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/Beronx86/blocks/tags","blobs_url":"https://api.github.com/repos/Beronx86/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Beronx86/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Beronx86/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Beronx86/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Beronx86/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/Beronx86/blocks/languages","stargazers_url":"https://api.github.com/repos/Beronx86/blocks/stargazers","contributors_url":"https://api.github.com/repos/Beronx86/blocks/contributors","subscribers_url":"https://api.github.com/repos/Beronx86/blocks/subscribers","subscription_url":"https://api.github.com/repos/Beronx86/blocks/subscription","commits_url":"https://api.github.com/repos/Beronx86/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Beronx86/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Beronx86/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Beronx86/blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Beronx86/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/Beronx86/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Beronx86/blocks/merges","archive_url":"https://api.github.com/repos/Beronx86/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Beronx86/blocks/downloads","issues_url":"https://api.github.com/repos/Beronx86/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/Beronx86/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/Beronx86/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/Beronx86/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Beronx86/blocks/labels{/name}","releases_url":"https://api.github.com/repos/Beronx86/blocks/releases{/id}","deployments_url":"https://api.github.com/repos/Beronx86/blocks/deployments","created_at":"2016-06-08T03:49:21Z","updated_at":"2016-06-08T03:49:22Z","pushed_at":"2016-06-08T07:05:25Z","git_url":"git://github.com/Beronx86/blocks.git","ssh_url":"git@github.com:Beronx86/blocks.git","clone_url":"https://github.com/Beronx86/blocks.git","svn_url":"https://github.com/Beronx86/blocks","homepage":"","size":4487,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"mila-udem:master","ref":"master","sha":"d7a30600a64f34e711fbde35ca93d756c6cbf37a","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}","deployments_url":"https://api.github.com/repos/mila-udem/blocks/deployments","created_at":"2014-10-06T00:08:32Z","updated_at":"2016-06-13T13:40:58Z","pushed_at":"2016-06-12T13:39:51Z","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":26115,"stargazers_count":822,"watchers_count":822,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":248,"mirror_url":null,"open_issues_count":176,"forks":248,"open_issues":176,"watchers":822,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/1113"},"html":{"href":"https://github.com/mila-udem/blocks/pull/1113"},"issue":{"href":"https://api.github.com/repos/mila-udem/blocks/issues/1113"},"comments":{"href":"https://api.github.com/repos/mila-udem/blocks/issues/1113/comments"},"review_comments":{"href":"https://api.github.com/repos/mila-udem/blocks/pulls/1113/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/1113/commits"},"statuses":{"href":"https://api.github.com/repos/mila-udem/blocks/statuses/2fdba23baaeb8a30aad6b5f615807da1614b35d5"}}}}
{"actor":{"display_login":"dmitriy-serdyuk"}}