{"action":"created","comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments/58459145","id":58459145,"diff_hunk":"@@ -58,35 +57,85 @@ def testBatch(self):\n     self._verifyCholesky(np.vstack((simple_array, simple_array)))\n     odd_sized_array = np.array([[[4., -1., 2.], [-1., 6., 0], [2., 0., 5.]]])\n     self._verifyCholesky(np.vstack((odd_sized_array, odd_sized_array)))\n-\n-    # Generate random positive-definite matrices.\n+ \n+     # Generate random positive-definite matrices.\n     matrices = np.random.rand(10, 5, 5)\n     for i in xrange(10):\n       matrices[i] = np.dot(matrices[i].T, matrices[i])\n     self._verifyCholesky(matrices)\n-\n+ \n   def testNonSquareMatrix(self):\n     with self.assertRaises(ValueError):\n       tf.cholesky(np.array([[1., 2., 3.], [3., 4., 5.]]))\n-\n+ \n   def testWrongDimensions(self):\n     tensor3 = tf.constant([1., 2.])\n     with self.assertRaises(ValueError):\n       tf.cholesky(tensor3)\n-\n+ \n   def testNotInvertible(self):\n-    # The input should be invertible.\n+     # The input should be invertible.\n     with self.test_session():\n       with self.assertRaisesOpError(\"LLT decomposition was not successful. The \"\n                                     \"input might not be valid.\"):\n-        # All rows of the matrix below add to zero\n+         # All rows of the matrix below add to zero\n         self._verifyCholesky(np.array([[1., -1., 0.], [-1., 1., -1.], [0., -1.,\n                                                                        1.]]))\n+ \n+  def testEmpty(self):\n+    self._verifyCholesky(np.empty([0, 2, 2]))\n+    self._verifyCholesky(np.empty([2, 0, 0]))\n \n   def testEmpty(self):\n     self._verifyCholesky(np.empty([0, 2, 2]))\n     self._verifyCholesky(np.empty([2, 0, 0]))\n \n+class CholeskyGradTest(tf.test.TestCase):\n+  _backprop_block_size = 32   \n+  \n+  def getShapes(self,shapeList):\n+    return ( (elem, int(np.floor(1.2*elem))) for elem in shapeList )\n+    \n+  def testSmallMatrices(self): \n+    np.random.seed(0)  \n+    shapes = self.getShapes([1,2,10])\n+    self.runFiniteDifferences(shapes)\n+\n+  def testOneBlockMatrices(self):\n+    np.random.seed(0)  \n+    shapes = self.getShapes([self._backprop_block_size+1])\n+    self.runFiniteDifferences(shapes,dtypes=(tf.float32, tf.float64),scalarTest=True)      ","path":"tensorflow/python/kernel_tests/cholesky_op_test.py","position":77,"original_position":77,"commit_id":"0249e5def1ac9b7af29fd336abba358f95c793fe","original_commit_id":"0249e5def1ac9b7af29fd336abba358f95c793fe","user":{"login":"rmlarsen","id":16907534,"avatar_url":"https://avatars.githubusercontent.com/u/16907534?v=3","gravatar_id":"","url":"https://api.github.com/users/rmlarsen","html_url":"https://github.com/rmlarsen","followers_url":"https://api.github.com/users/rmlarsen/followers","following_url":"https://api.github.com/users/rmlarsen/following{/other_user}","gists_url":"https://api.github.com/users/rmlarsen/gists{/gist_id}","starred_url":"https://api.github.com/users/rmlarsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmlarsen/subscriptions","organizations_url":"https://api.github.com/users/rmlarsen/orgs","repos_url":"https://api.github.com/users/rmlarsen/repos","events_url":"https://api.github.com/users/rmlarsen/events{/privacy}","received_events_url":"https://api.github.com/users/rmlarsen/received_events","type":"User","site_admin":false},"body":"Nit: Space after comm. Same everywhere.","created_at":"2016-04-04T22:20:14Z","updated_at":"2016-04-04T22:20:14Z","html_url":"https://github.com/tensorflow/tensorflow/pull/1465#discussion_r58459145","pull_request_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465","_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments/58459145"},"html":{"href":"https://github.com/tensorflow/tensorflow/pull/1465#discussion_r58459145"},"pull_request":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465"}}},"pull_request":{"url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465","id":62553090,"html_url":"https://github.com/tensorflow/tensorflow/pull/1465","diff_url":"https://github.com/tensorflow/tensorflow/pull/1465.diff","patch_url":"https://github.com/tensorflow/tensorflow/pull/1465.patch","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1465","number":1465,"state":"open","locked":false,"title":"Cholesky backpropagation","user":{"login":"alexggmatthews","id":6596998,"avatar_url":"https://avatars.githubusercontent.com/u/6596998?v=3","gravatar_id":"","url":"https://api.github.com/users/alexggmatthews","html_url":"https://github.com/alexggmatthews","followers_url":"https://api.github.com/users/alexggmatthews/followers","following_url":"https://api.github.com/users/alexggmatthews/following{/other_user}","gists_url":"https://api.github.com/users/alexggmatthews/gists{/gist_id}","starred_url":"https://api.github.com/users/alexggmatthews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexggmatthews/subscriptions","organizations_url":"https://api.github.com/users/alexggmatthews/orgs","repos_url":"https://api.github.com/users/alexggmatthews/repos","events_url":"https://api.github.com/users/alexggmatthews/events{/privacy}","received_events_url":"https://api.github.com/users/alexggmatthews/received_events","type":"User","site_admin":false},"body":"This implements a gradient op for the Cholesky op as requested and discussed in #367 .\r\n\r\nThe code was written by myself and Dr. James Henman (user name @jameshensman ).\r\n\r\nThe implementation is a blocked cholesky backpropagation as advocated by Dr. Iain Murray in this recent paper http://arxiv.org/abs/1602.07527\r\n\r\nNew unit tests are included. \r\n\r\nA lot of work has gone into the implementation of the algorithm and I therefore believe the code has value to the community. Less work so far has gone in to tightly integrating it with TensorFlow code base and I am looking for help and advice from the TensorFlow team. As such it should be regarded as a work in progress.  @martinwicke suggested the best path forward was to submit this pull request. ","created_at":"2016-03-11T14:51:21Z","updated_at":"2016-04-04T22:20:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93fb8ca53afa624dfe45df0d5e953d23e41955e6","assignee":{"login":"rmlarsen","id":16907534,"avatar_url":"https://avatars.githubusercontent.com/u/16907534?v=3","gravatar_id":"","url":"https://api.github.com/users/rmlarsen","html_url":"https://github.com/rmlarsen","followers_url":"https://api.github.com/users/rmlarsen/followers","following_url":"https://api.github.com/users/rmlarsen/following{/other_user}","gists_url":"https://api.github.com/users/rmlarsen/gists{/gist_id}","starred_url":"https://api.github.com/users/rmlarsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmlarsen/subscriptions","organizations_url":"https://api.github.com/users/rmlarsen/orgs","repos_url":"https://api.github.com/users/rmlarsen/repos","events_url":"https://api.github.com/users/rmlarsen/events{/privacy}","received_events_url":"https://api.github.com/users/rmlarsen/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465/commits","review_comments_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465/comments","review_comment_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1465/comments","statuses_url":"https://api.github.com/repos/tensorflow/tensorflow/statuses/0249e5def1ac9b7af29fd336abba358f95c793fe","head":{"label":"alexggmatthews:cholesky_backpropagation","ref":"cholesky_backpropagation","sha":"0249e5def1ac9b7af29fd336abba358f95c793fe","user":{"login":"alexggmatthews","id":6596998,"avatar_url":"https://avatars.githubusercontent.com/u/6596998?v=3","gravatar_id":"","url":"https://api.github.com/users/alexggmatthews","html_url":"https://github.com/alexggmatthews","followers_url":"https://api.github.com/users/alexggmatthews/followers","following_url":"https://api.github.com/users/alexggmatthews/following{/other_user}","gists_url":"https://api.github.com/users/alexggmatthews/gists{/gist_id}","starred_url":"https://api.github.com/users/alexggmatthews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexggmatthews/subscriptions","organizations_url":"https://api.github.com/users/alexggmatthews/orgs","repos_url":"https://api.github.com/users/alexggmatthews/repos","events_url":"https://api.github.com/users/alexggmatthews/events{/privacy}","received_events_url":"https://api.github.com/users/alexggmatthews/received_events","type":"User","site_admin":false},"repo":{"id":53671896,"name":"tensorflow","full_name":"alexggmatthews/tensorflow","owner":{"login":"alexggmatthews","id":6596998,"avatar_url":"https://avatars.githubusercontent.com/u/6596998?v=3","gravatar_id":"","url":"https://api.github.com/users/alexggmatthews","html_url":"https://github.com/alexggmatthews","followers_url":"https://api.github.com/users/alexggmatthews/followers","following_url":"https://api.github.com/users/alexggmatthews/following{/other_user}","gists_url":"https://api.github.com/users/alexggmatthews/gists{/gist_id}","starred_url":"https://api.github.com/users/alexggmatthews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexggmatthews/subscriptions","organizations_url":"https://api.github.com/users/alexggmatthews/orgs","repos_url":"https://api.github.com/users/alexggmatthews/repos","events_url":"https://api.github.com/users/alexggmatthews/events{/privacy}","received_events_url":"https://api.github.com/users/alexggmatthews/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexggmatthews/tensorflow","description":"Computation using data flow graphs for scalable machine learning","fork":true,"url":"https://api.github.com/repos/alexggmatthews/tensorflow","forks_url":"https://api.github.com/repos/alexggmatthews/tensorflow/forks","keys_url":"https://api.github.com/repos/alexggmatthews/tensorflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexggmatthews/tensorflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexggmatthews/tensorflow/teams","hooks_url":"https://api.github.com/repos/alexggmatthews/tensorflow/hooks","issue_events_url":"https://api.github.com/repos/alexggmatthews/tensorflow/issues/events{/number}","events_url":"https://api.github.com/repos/alexggmatthews/tensorflow/events","assignees_url":"https://api.github.com/repos/alexggmatthews/tensorflow/assignees{/user}","branches_url":"https://api.github.com/repos/alexggmatthews/tensorflow/branches{/branch}","tags_url":"https://api.github.com/repos/alexggmatthews/tensorflow/tags","blobs_url":"https://api.github.com/repos/alexggmatthews/tensorflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexggmatthews/tensorflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexggmatthews/tensorflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexggmatthews/tensorflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexggmatthews/tensorflow/statuses/{sha}","languages_url":"https://api.github.com/repos/alexggmatthews/tensorflow/languages","stargazers_url":"https://api.github.com/repos/alexggmatthews/tensorflow/stargazers","contributors_url":"https://api.github.com/repos/alexggmatthews/tensorflow/contributors","subscribers_url":"https://api.github.com/repos/alexggmatthews/tensorflow/subscribers","subscription_url":"https://api.github.com/repos/alexggmatthews/tensorflow/subscription","commits_url":"https://api.github.com/repos/alexggmatthews/tensorflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexggmatthews/tensorflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexggmatthews/tensorflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexggmatthews/tensorflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexggmatthews/tensorflow/contents/{+path}","compare_url":"https://api.github.com/repos/alexggmatthews/tensorflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexggmatthews/tensorflow/merges","archive_url":"https://api.github.com/repos/alexggmatthews/tensorflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexggmatthews/tensorflow/downloads","issues_url":"https://api.github.com/repos/alexggmatthews/tensorflow/issues{/number}","pulls_url":"https://api.github.com/repos/alexggmatthews/tensorflow/pulls{/number}","milestones_url":"https://api.github.com/repos/alexggmatthews/tensorflow/milestones{/number}","notifications_url":"https://api.github.com/repos/alexggmatthews/tensorflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexggmatthews/tensorflow/labels{/name}","releases_url":"https://api.github.com/repos/alexggmatthews/tensorflow/releases{/id}","deployments_url":"https://api.github.com/repos/alexggmatthews/tensorflow/deployments","created_at":"2016-03-11T14:17:01Z","updated_at":"2016-03-11T14:17:06Z","pushed_at":"2016-04-04T18:43:32Z","git_url":"git://github.com/alexggmatthews/tensorflow.git","ssh_url":"git@github.com:alexggmatthews/tensorflow.git","clone_url":"https://github.com/alexggmatthews/tensorflow.git","svn_url":"https://github.com/alexggmatthews/tensorflow","homepage":"http://tensorflow.org","size":31911,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"tensorflow:master","ref":"master","sha":"de5101da4638ac469041575dadb4921ebb33eb6a","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-04-04T21:28:33Z","pushed_at":"2016-04-04T21:21:46Z","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":135680,"stargazers_count":20637,"watchers_count":20637,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7351,"mirror_url":null,"open_issues_count":337,"forks":7351,"open_issues":337,"watchers":20637,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465"},"html":{"href":"https://github.com/tensorflow/tensorflow/pull/1465"},"issue":{"href":"https://api.github.com/repos/tensorflow/tensorflow/issues/1465"},"comments":{"href":"https://api.github.com/repos/tensorflow/tensorflow/issues/1465/comments"},"review_comments":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465/comments"},"review_comment":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1465/commits"},"statuses":{"href":"https://api.github.com/repos/tensorflow/tensorflow/statuses/0249e5def1ac9b7af29fd336abba358f95c793fe"}}}}