{"action":"created","comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments/83571277","pull_request_review_id":4406234,"id":83571277,"diff_hunk":"@@ -690,6 +695,34 @@ def _get_single_variable(self,\n     return v\n \n \n+  # Initialize variable when no initializer provided\n+  def _get_default_initializer(self, shape=None, dtype=dtypes.float32):\n+    \"\"\"Use this function to provide a default and corresponding initializer of dtype\n+\n+    Args:\n+      dtype: Type of the new or existing variable.(defaults to `DT_FLOAT`).\n+\n+    Returns:\n+      initializer and initializing_from_value. See documentation of get_variable above.\n+\n+    Raises:\n+      TypeError: When giving unsupported dtype.\n+    \"\"\"\n+    if dtype.is_floating:\n+      initializer = init_ops.uniform_unit_scaling_initializer()\n+      initializing_from_value = False\n+    elif dtype.is_string:","path":"tensorflow/python/ops/variable_scope.py","position":48,"original_position":48,"commit_id":"0e7d8211b9f6e927eff5e9e96a3e439cfdcbeb11","original_commit_id":"0e7d8211b9f6e927eff5e9e96a3e439cfdcbeb11","user":{"login":"DjangoPeng","id":16943353,"avatar_url":"https://avatars.githubusercontent.com/u/16943353?v=3","gravatar_id":"","url":"https://api.github.com/users/DjangoPeng","html_url":"https://github.com/DjangoPeng","followers_url":"https://api.github.com/users/DjangoPeng/followers","following_url":"https://api.github.com/users/DjangoPeng/following{/other_user}","gists_url":"https://api.github.com/users/DjangoPeng/gists{/gist_id}","starred_url":"https://api.github.com/users/DjangoPeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DjangoPeng/subscriptions","organizations_url":"https://api.github.com/users/DjangoPeng/orgs","repos_url":"https://api.github.com/users/DjangoPeng/repos","events_url":"https://api.github.com/users/DjangoPeng/events{/privacy}","received_events_url":"https://api.github.com/users/DjangoPeng/received_events","type":"User","site_admin":false},"body":"I think tf.string is the same issue regarding initialization, so put them in one PR. If you insist that they are different, I can split them to reopen a PR for tf.string","created_at":"2016-10-17T02:50:13Z","updated_at":"2016-10-17T02:50:13Z","html_url":"https://github.com/tensorflow/tensorflow/pull/4826#discussion_r83571277","pull_request_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826","_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments/83571277"},"html":{"href":"https://github.com/tensorflow/tensorflow/pull/4826#discussion_r83571277"},"pull_request":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826"}}},"pull_request":{"url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826","id":88464605,"html_url":"https://github.com/tensorflow/tensorflow/pull/4826","diff_url":"https://github.com/tensorflow/tensorflow/pull/4826.diff","patch_url":"https://github.com/tensorflow/tensorflow/pull/4826.patch","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4826","number":4826,"state":"open","locked":false,"title":"[bug]Fix a issue (#4419)","user":{"login":"DjangoPeng","id":16943353,"avatar_url":"https://avatars.githubusercontent.com/u/16943353?v=3","gravatar_id":"","url":"https://api.github.com/users/DjangoPeng","html_url":"https://github.com/DjangoPeng","followers_url":"https://api.github.com/users/DjangoPeng/followers","following_url":"https://api.github.com/users/DjangoPeng/following{/other_user}","gists_url":"https://api.github.com/users/DjangoPeng/gists{/gist_id}","starred_url":"https://api.github.com/users/DjangoPeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DjangoPeng/subscriptions","organizations_url":"https://api.github.com/users/DjangoPeng/orgs","repos_url":"https://api.github.com/users/DjangoPeng/repos","events_url":"https://api.github.com/users/DjangoPeng/events{/privacy}","received_events_url":"https://api.github.com/users/DjangoPeng/received_events","type":"User","site_admin":false},"body":"When using `tf.get_variable(name='foo', shape=(42,), dtype=tf.int32)` without initializer argument, it causes the error:\r\n```\r\nTypeError: Expected int32, got -1.7320508075688772 of type 'float' instead.\r\n```\r\nThe reason is as follows:\r\nIf an initializer is not provided (and a default one is not set), a uniform unit scaling init is used (notice that sqrt(3)==1.7320...), which of course conflicts with the requested integer type.\r\n\r\nSo, the current solution is initialize the integer by `init_ops.zeros_initializer` if no initializer provided.\r\n\r\nreference the [issus#4419](https://github.com/tensorflow/tensorflow/issues/4419)","created_at":"2016-10-07T16:01:28Z","updated_at":"2016-10-17T02:50:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64f7501e8d5ee7c3d03ed3b93f38a882c78b7ee2","assignee":{"login":"rohan100jain","id":144114,"avatar_url":"https://avatars.githubusercontent.com/u/144114?v=3","gravatar_id":"","url":"https://api.github.com/users/rohan100jain","html_url":"https://github.com/rohan100jain","followers_url":"https://api.github.com/users/rohan100jain/followers","following_url":"https://api.github.com/users/rohan100jain/following{/other_user}","gists_url":"https://api.github.com/users/rohan100jain/gists{/gist_id}","starred_url":"https://api.github.com/users/rohan100jain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohan100jain/subscriptions","organizations_url":"https://api.github.com/users/rohan100jain/orgs","repos_url":"https://api.github.com/users/rohan100jain/repos","events_url":"https://api.github.com/users/rohan100jain/events{/privacy}","received_events_url":"https://api.github.com/users/rohan100jain/received_events","type":"User","site_admin":false},"assignees":[{"login":"rohan100jain","id":144114,"avatar_url":"https://avatars.githubusercontent.com/u/144114?v=3","gravatar_id":"","url":"https://api.github.com/users/rohan100jain","html_url":"https://github.com/rohan100jain","followers_url":"https://api.github.com/users/rohan100jain/followers","following_url":"https://api.github.com/users/rohan100jain/following{/other_user}","gists_url":"https://api.github.com/users/rohan100jain/gists{/gist_id}","starred_url":"https://api.github.com/users/rohan100jain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohan100jain/subscriptions","organizations_url":"https://api.github.com/users/rohan100jain/orgs","repos_url":"https://api.github.com/users/rohan100jain/repos","events_url":"https://api.github.com/users/rohan100jain/events{/privacy}","received_events_url":"https://api.github.com/users/rohan100jain/received_events","type":"User","site_admin":false},{"login":"ebrevdo","id":1794715,"avatar_url":"https://avatars.githubusercontent.com/u/1794715?v=3","gravatar_id":"","url":"https://api.github.com/users/ebrevdo","html_url":"https://github.com/ebrevdo","followers_url":"https://api.github.com/users/ebrevdo/followers","following_url":"https://api.github.com/users/ebrevdo/following{/other_user}","gists_url":"https://api.github.com/users/ebrevdo/gists{/gist_id}","starred_url":"https://api.github.com/users/ebrevdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebrevdo/subscriptions","organizations_url":"https://api.github.com/users/ebrevdo/orgs","repos_url":"https://api.github.com/users/ebrevdo/repos","events_url":"https://api.github.com/users/ebrevdo/events{/privacy}","received_events_url":"https://api.github.com/users/ebrevdo/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826/commits","review_comments_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826/comments","review_comment_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/4826/comments","statuses_url":"https://api.github.com/repos/tensorflow/tensorflow/statuses/0e7d8211b9f6e927eff5e9e96a3e439cfdcbeb11","head":{"label":"DjangoPeng:variable-patch","ref":"variable-patch","sha":"0e7d8211b9f6e927eff5e9e96a3e439cfdcbeb11","user":{"login":"DjangoPeng","id":16943353,"avatar_url":"https://avatars.githubusercontent.com/u/16943353?v=3","gravatar_id":"","url":"https://api.github.com/users/DjangoPeng","html_url":"https://github.com/DjangoPeng","followers_url":"https://api.github.com/users/DjangoPeng/followers","following_url":"https://api.github.com/users/DjangoPeng/following{/other_user}","gists_url":"https://api.github.com/users/DjangoPeng/gists{/gist_id}","starred_url":"https://api.github.com/users/DjangoPeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DjangoPeng/subscriptions","organizations_url":"https://api.github.com/users/DjangoPeng/orgs","repos_url":"https://api.github.com/users/DjangoPeng/repos","events_url":"https://api.github.com/users/DjangoPeng/events{/privacy}","received_events_url":"https://api.github.com/users/DjangoPeng/received_events","type":"User","site_admin":false},"repo":{"id":63581410,"name":"tensorflow","full_name":"DjangoPeng/tensorflow","owner":{"login":"DjangoPeng","id":16943353,"avatar_url":"https://avatars.githubusercontent.com/u/16943353?v=3","gravatar_id":"","url":"https://api.github.com/users/DjangoPeng","html_url":"https://github.com/DjangoPeng","followers_url":"https://api.github.com/users/DjangoPeng/followers","following_url":"https://api.github.com/users/DjangoPeng/following{/other_user}","gists_url":"https://api.github.com/users/DjangoPeng/gists{/gist_id}","starred_url":"https://api.github.com/users/DjangoPeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DjangoPeng/subscriptions","organizations_url":"https://api.github.com/users/DjangoPeng/orgs","repos_url":"https://api.github.com/users/DjangoPeng/repos","events_url":"https://api.github.com/users/DjangoPeng/events{/privacy}","received_events_url":"https://api.github.com/users/DjangoPeng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DjangoPeng/tensorflow","description":"Computation using data flow graphs for scalable machine learning","fork":true,"url":"https://api.github.com/repos/DjangoPeng/tensorflow","forks_url":"https://api.github.com/repos/DjangoPeng/tensorflow/forks","keys_url":"https://api.github.com/repos/DjangoPeng/tensorflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DjangoPeng/tensorflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DjangoPeng/tensorflow/teams","hooks_url":"https://api.github.com/repos/DjangoPeng/tensorflow/hooks","issue_events_url":"https://api.github.com/repos/DjangoPeng/tensorflow/issues/events{/number}","events_url":"https://api.github.com/repos/DjangoPeng/tensorflow/events","assignees_url":"https://api.github.com/repos/DjangoPeng/tensorflow/assignees{/user}","branches_url":"https://api.github.com/repos/DjangoPeng/tensorflow/branches{/branch}","tags_url":"https://api.github.com/repos/DjangoPeng/tensorflow/tags","blobs_url":"https://api.github.com/repos/DjangoPeng/tensorflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DjangoPeng/tensorflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DjangoPeng/tensorflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/DjangoPeng/tensorflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DjangoPeng/tensorflow/statuses/{sha}","languages_url":"https://api.github.com/repos/DjangoPeng/tensorflow/languages","stargazers_url":"https://api.github.com/repos/DjangoPeng/tensorflow/stargazers","contributors_url":"https://api.github.com/repos/DjangoPeng/tensorflow/contributors","subscribers_url":"https://api.github.com/repos/DjangoPeng/tensorflow/subscribers","subscription_url":"https://api.github.com/repos/DjangoPeng/tensorflow/subscription","commits_url":"https://api.github.com/repos/DjangoPeng/tensorflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/DjangoPeng/tensorflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/DjangoPeng/tensorflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/DjangoPeng/tensorflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/DjangoPeng/tensorflow/contents/{+path}","compare_url":"https://api.github.com/repos/DjangoPeng/tensorflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DjangoPeng/tensorflow/merges","archive_url":"https://api.github.com/repos/DjangoPeng/tensorflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DjangoPeng/tensorflow/downloads","issues_url":"https://api.github.com/repos/DjangoPeng/tensorflow/issues{/number}","pulls_url":"https://api.github.com/repos/DjangoPeng/tensorflow/pulls{/number}","milestones_url":"https://api.github.com/repos/DjangoPeng/tensorflow/milestones{/number}","notifications_url":"https://api.github.com/repos/DjangoPeng/tensorflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DjangoPeng/tensorflow/labels{/name}","releases_url":"https://api.github.com/repos/DjangoPeng/tensorflow/releases{/id}","deployments_url":"https://api.github.com/repos/DjangoPeng/tensorflow/deployments","created_at":"2016-07-18T07:48:20Z","updated_at":"2016-10-04T07:49:47Z","pushed_at":"2016-10-17T00:39:31Z","git_url":"git://github.com/DjangoPeng/tensorflow.git","ssh_url":"git@github.com:DjangoPeng/tensorflow.git","clone_url":"https://github.com/DjangoPeng/tensorflow.git","svn_url":"https://github.com/DjangoPeng/tensorflow","homepage":"http://tensorflow.org","size":63125,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"tensorflow:master","ref":"master","sha":"55ab5ef81f2557642f773a2bf3c2c13eb5a45c2e","user":{"login":"tensorflow","id":15658638,"avatar_url":"https://avatars.githubusercontent.com/u/15658638?v=3","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"repo":{"id":45717250,"name":"tensorflow","full_name":"tensorflow/tensorflow","owner":{"login":"tensorflow","id":15658638,"avatar_url":"https://avatars.githubusercontent.com/u/15658638?v=3","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tensorflow/tensorflow","description":"Computation using data flow graphs for scalable machine learning","fork":false,"url":"https://api.github.com/repos/tensorflow/tensorflow","forks_url":"https://api.github.com/repos/tensorflow/tensorflow/forks","keys_url":"https://api.github.com/repos/tensorflow/tensorflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tensorflow/tensorflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tensorflow/tensorflow/teams","hooks_url":"https://api.github.com/repos/tensorflow/tensorflow/hooks","issue_events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/events{/number}","events_url":"https://api.github.com/repos/tensorflow/tensorflow/events","assignees_url":"https://api.github.com/repos/tensorflow/tensorflow/assignees{/user}","branches_url":"https://api.github.com/repos/tensorflow/tensorflow/branches{/branch}","tags_url":"https://api.github.com/repos/tensorflow/tensorflow/tags","blobs_url":"https://api.github.com/repos/tensorflow/tensorflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tensorflow/tensorflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tensorflow/tensorflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/tensorflow/tensorflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tensorflow/tensorflow/statuses/{sha}","languages_url":"https://api.github.com/repos/tensorflow/tensorflow/languages","stargazers_url":"https://api.github.com/repos/tensorflow/tensorflow/stargazers","contributors_url":"https://api.github.com/repos/tensorflow/tensorflow/contributors","subscribers_url":"https://api.github.com/repos/tensorflow/tensorflow/subscribers","subscription_url":"https://api.github.com/repos/tensorflow/tensorflow/subscription","commits_url":"https://api.github.com/repos/tensorflow/tensorflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/tensorflow/tensorflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/tensorflow/tensorflow/contents/{+path}","compare_url":"https://api.github.com/repos/tensorflow/tensorflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tensorflow/tensorflow/merges","archive_url":"https://api.github.com/repos/tensorflow/tensorflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tensorflow/tensorflow/downloads","issues_url":"https://api.github.com/repos/tensorflow/tensorflow/issues{/number}","pulls_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls{/number}","milestones_url":"https://api.github.com/repos/tensorflow/tensorflow/milestones{/number}","notifications_url":"https://api.github.com/repos/tensorflow/tensorflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/labels{/name}","releases_url":"https://api.github.com/repos/tensorflow/tensorflow/releases{/id}","deployments_url":"https://api.github.com/repos/tensorflow/tensorflow/deployments","created_at":"2015-11-07T01:19:20Z","updated_at":"2016-10-17T02:49:42Z","pushed_at":"2016-10-17T02:43:57Z","git_url":"git://github.com/tensorflow/tensorflow.git","ssh_url":"git@github.com:tensorflow/tensorflow.git","clone_url":"https://github.com/tensorflow/tensorflow.git","svn_url":"https://github.com/tensorflow/tensorflow","homepage":"http://tensorflow.org","size":235723,"stargazers_count":34442,"watchers_count":34442,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15181,"mirror_url":null,"open_issues_count":613,"forks":15181,"open_issues":613,"watchers":34442,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826"},"html":{"href":"https://github.com/tensorflow/tensorflow/pull/4826"},"issue":{"href":"https://api.github.com/repos/tensorflow/tensorflow/issues/4826"},"comments":{"href":"https://api.github.com/repos/tensorflow/tensorflow/issues/4826/comments"},"review_comments":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826/comments"},"review_comment":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/4826/commits"},"statuses":{"href":"https://api.github.com/repos/tensorflow/tensorflow/statuses/0e7d8211b9f6e927eff5e9e96a3e439cfdcbeb11"}}}}
{"actor":{"display_login":"DjangoPeng"}}