{"action":"created","comment":{"url":"https://api.github.com/repos/probtorch/pytorch/pulls/comments/157551581","pull_request_review_id":84212090,"id":157551581,"diff_hunk":"@@ -0,0 +1,38 @@\n+from numbers import Number\n+import torch\n+from torch.distributions.distribution import Distribution\n+from torch.distributions.utils import broadcast_all\n+\n+\n+class Exponential(Distribution):\n+    r\"\"\"\n+    Creates a Exponential distribution parameterized by `rate`.\n+\n+    Example::\n+\n+        >>> m = Exponential(torch.Tensor([1.0]))\n+        >>> m.sample()  # Exponential distributed with rate=1\n+         0.1046\n+        [torch.FloatTensor of size 1]\n+\n+    Args:\n+        rate (float or Tensor or Variable): rate = 1 / scale of the distribution\n+    \"\"\"\n+    has_rsample = True\n+\n+    def __init__(self, rate):\n+        self.rate, = broadcast_all(rate)\n+        batch_shape = torch.Size() if isinstance(rate, Number) else self.rate.size()\n+        super(Exponential, self).__init__(batch_shape)\n+\n+    def rsample(self, sample_shape=torch.Size()):\n+        shape = self._extended_shape(sample_shape)\n+        # NOTE: Current code fails _check_sampler_sampler when rate=10 with failure_rate=1e-3","path":"torch/distributions/exponential.py","position":30,"original_position":30,"commit_id":"10bd1e8477a937da9cd64a7ef0f644be0f98ebda","original_commit_id":"10bd1e8477a937da9cd64a7ef0f644be0f98ebda","user":{"login":"fritzo","id":648532,"avatar_url":"https://avatars0.githubusercontent.com/u/648532?v=4","gravatar_id":"","url":"https://api.github.com/users/fritzo","html_url":"https://github.com/fritzo","followers_url":"https://api.github.com/users/fritzo/followers","following_url":"https://api.github.com/users/fritzo/following{/other_user}","gists_url":"https://api.github.com/users/fritzo/gists{/gist_id}","starred_url":"https://api.github.com/users/fritzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritzo/subscriptions","organizations_url":"https://api.github.com/users/fritzo/orgs","repos_url":"https://api.github.com/users/fritzo/repos","events_url":"https://api.github.com/users/fritzo/events{/privacy}","received_events_url":"https://api.github.com/users/fritzo/received_events","type":"User","site_admin":false},"body":"I think it's fine to omit the note. Randomized tests are expected to fail occasionally. It's probably better to just increment the seeds of failing tests, and make sure not too many seeds are incremented.","created_at":"2017-12-18T17:38:59Z","updated_at":"2017-12-18T17:42:04Z","html_url":"https://github.com/probtorch/pytorch/pull/35#discussion_r157551581","pull_request_url":"https://api.github.com/repos/probtorch/pytorch/pulls/35","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/probtorch/pytorch/pulls/comments/157551581"},"html":{"href":"https://github.com/probtorch/pytorch/pull/35#discussion_r157551581"},"pull_request":{"href":"https://api.github.com/repos/probtorch/pytorch/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/probtorch/pytorch/pulls/35","id":158762146,"html_url":"https://github.com/probtorch/pytorch/pull/35","diff_url":"https://github.com/probtorch/pytorch/pull/35.diff","patch_url":"https://github.com/probtorch/pytorch/pull/35.patch","issue_url":"https://api.github.com/repos/probtorch/pytorch/issues/35","number":35,"state":"open","locked":false,"title":"Exponential distribution","user":{"login":"alicanb","id":1093846,"avatar_url":"https://avatars2.githubusercontent.com/u/1093846?v=4","gravatar_id":"","url":"https://api.github.com/users/alicanb","html_url":"https://github.com/alicanb","followers_url":"https://api.github.com/users/alicanb/followers","following_url":"https://api.github.com/users/alicanb/following{/other_user}","gists_url":"https://api.github.com/users/alicanb/gists{/gist_id}","starred_url":"https://api.github.com/users/alicanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alicanb/subscriptions","organizations_url":"https://api.github.com/users/alicanb/orgs","repos_url":"https://api.github.com/users/alicanb/repos","events_url":"https://api.github.com/users/alicanb/events{/privacy}","received_events_url":"https://api.github.com/users/alicanb/received_events","type":"User","site_admin":false},"body":"Closes #11","created_at":"2017-12-16T22:03:45Z","updated_at":"2017-12-18T17:42:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b5c601abdd6637d42c47e4b46371ed48d9061bd","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/probtorch/pytorch/pulls/35/commits","review_comments_url":"https://api.github.com/repos/probtorch/pytorch/pulls/35/comments","review_comment_url":"https://api.github.com/repos/probtorch/pytorch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/probtorch/pytorch/issues/35/comments","statuses_url":"https://api.github.com/repos/probtorch/pytorch/statuses/10bd1e8477a937da9cd64a7ef0f644be0f98ebda","head":{"label":"probtorch:dist-exp","ref":"dist-exp","sha":"10bd1e8477a937da9cd64a7ef0f644be0f98ebda","user":{"login":"probtorch","id":32777003,"avatar_url":"https://avatars0.githubusercontent.com/u/32777003?v=4","gravatar_id":"","url":"https://api.github.com/users/probtorch","html_url":"https://github.com/probtorch","followers_url":"https://api.github.com/users/probtorch/followers","following_url":"https://api.github.com/users/probtorch/following{/other_user}","gists_url":"https://api.github.com/users/probtorch/gists{/gist_id}","starred_url":"https://api.github.com/users/probtorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/probtorch/subscriptions","organizations_url":"https://api.github.com/users/probtorch/orgs","repos_url":"https://api.github.com/users/probtorch/repos","events_url":"https://api.github.com/users/probtorch/events{/privacy}","received_events_url":"https://api.github.com/users/probtorch/received_events","type":"Organization","site_admin":false},"repo":{"id":109045956,"name":"pytorch","full_name":"probtorch/pytorch","owner":{"login":"probtorch","id":32777003,"avatar_url":"https://avatars0.githubusercontent.com/u/32777003?v=4","gravatar_id":"","url":"https://api.github.com/users/probtorch","html_url":"https://github.com/probtorch","followers_url":"https://api.github.com/users/probtorch/followers","following_url":"https://api.github.com/users/probtorch/following{/other_user}","gists_url":"https://api.github.com/users/probtorch/gists{/gist_id}","starred_url":"https://api.github.com/users/probtorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/probtorch/subscriptions","organizations_url":"https://api.github.com/users/probtorch/orgs","repos_url":"https://api.github.com/users/probtorch/repos","events_url":"https://api.github.com/users/probtorch/events{/privacy}","received_events_url":"https://api.github.com/users/probtorch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/probtorch/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":true,"url":"https://api.github.com/repos/probtorch/pytorch","forks_url":"https://api.github.com/repos/probtorch/pytorch/forks","keys_url":"https://api.github.com/repos/probtorch/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/probtorch/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/probtorch/pytorch/teams","hooks_url":"https://api.github.com/repos/probtorch/pytorch/hooks","issue_events_url":"https://api.github.com/repos/probtorch/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/probtorch/pytorch/events","assignees_url":"https://api.github.com/repos/probtorch/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/probtorch/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/probtorch/pytorch/tags","blobs_url":"https://api.github.com/repos/probtorch/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/probtorch/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/probtorch/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/probtorch/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/probtorch/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/probtorch/pytorch/languages","stargazers_url":"https://api.github.com/repos/probtorch/pytorch/stargazers","contributors_url":"https://api.github.com/repos/probtorch/pytorch/contributors","subscribers_url":"https://api.github.com/repos/probtorch/pytorch/subscribers","subscription_url":"https://api.github.com/repos/probtorch/pytorch/subscription","commits_url":"https://api.github.com/repos/probtorch/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/probtorch/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/probtorch/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/probtorch/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/probtorch/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/probtorch/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/probtorch/pytorch/merges","archive_url":"https://api.github.com/repos/probtorch/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/probtorch/pytorch/downloads","issues_url":"https://api.github.com/repos/probtorch/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/probtorch/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/probtorch/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/probtorch/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/probtorch/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/probtorch/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/probtorch/pytorch/deployments","created_at":"2017-10-31T19:57:13Z","updated_at":"2017-12-13T15:29:39Z","pushed_at":"2017-12-18T17:31:49Z","git_url":"git://github.com/probtorch/pytorch.git","ssh_url":"git@github.com:probtorch/pytorch.git","clone_url":"https://github.com/probtorch/pytorch.git","svn_url":"https://github.com/probtorch/pytorch","homepage":"http://pytorch.org","size":20307,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":22,"license":null,"forks":0,"open_issues":22,"watchers":2,"default_branch":"master"}},"base":{"label":"probtorch:master","ref":"master","sha":"dde10e1d4b20d624c8a74aeb68f08fd6f5538ea3","user":{"login":"probtorch","id":32777003,"avatar_url":"https://avatars0.githubusercontent.com/u/32777003?v=4","gravatar_id":"","url":"https://api.github.com/users/probtorch","html_url":"https://github.com/probtorch","followers_url":"https://api.github.com/users/probtorch/followers","following_url":"https://api.github.com/users/probtorch/following{/other_user}","gists_url":"https://api.github.com/users/probtorch/gists{/gist_id}","starred_url":"https://api.github.com/users/probtorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/probtorch/subscriptions","organizations_url":"https://api.github.com/users/probtorch/orgs","repos_url":"https://api.github.com/users/probtorch/repos","events_url":"https://api.github.com/users/probtorch/events{/privacy}","received_events_url":"https://api.github.com/users/probtorch/received_events","type":"Organization","site_admin":false},"repo":{"id":109045956,"name":"pytorch","full_name":"probtorch/pytorch","owner":{"login":"probtorch","id":32777003,"avatar_url":"https://avatars0.githubusercontent.com/u/32777003?v=4","gravatar_id":"","url":"https://api.github.com/users/probtorch","html_url":"https://github.com/probtorch","followers_url":"https://api.github.com/users/probtorch/followers","following_url":"https://api.github.com/users/probtorch/following{/other_user}","gists_url":"https://api.github.com/users/probtorch/gists{/gist_id}","starred_url":"https://api.github.com/users/probtorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/probtorch/subscriptions","organizations_url":"https://api.github.com/users/probtorch/orgs","repos_url":"https://api.github.com/users/probtorch/repos","events_url":"https://api.github.com/users/probtorch/events{/privacy}","received_events_url":"https://api.github.com/users/probtorch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/probtorch/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":true,"url":"https://api.github.com/repos/probtorch/pytorch","forks_url":"https://api.github.com/repos/probtorch/pytorch/forks","keys_url":"https://api.github.com/repos/probtorch/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/probtorch/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/probtorch/pytorch/teams","hooks_url":"https://api.github.com/repos/probtorch/pytorch/hooks","issue_events_url":"https://api.github.com/repos/probtorch/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/probtorch/pytorch/events","assignees_url":"https://api.github.com/repos/probtorch/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/probtorch/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/probtorch/pytorch/tags","blobs_url":"https://api.github.com/repos/probtorch/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/probtorch/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/probtorch/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/probtorch/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/probtorch/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/probtorch/pytorch/languages","stargazers_url":"https://api.github.com/repos/probtorch/pytorch/stargazers","contributors_url":"https://api.github.com/repos/probtorch/pytorch/contributors","subscribers_url":"https://api.github.com/repos/probtorch/pytorch/subscribers","subscription_url":"https://api.github.com/repos/probtorch/pytorch/subscription","commits_url":"https://api.github.com/repos/probtorch/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/probtorch/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/probtorch/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/probtorch/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/probtorch/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/probtorch/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/probtorch/pytorch/merges","archive_url":"https://api.github.com/repos/probtorch/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/probtorch/pytorch/downloads","issues_url":"https://api.github.com/repos/probtorch/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/probtorch/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/probtorch/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/probtorch/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/probtorch/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/probtorch/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/probtorch/pytorch/deployments","created_at":"2017-10-31T19:57:13Z","updated_at":"2017-12-13T15:29:39Z","pushed_at":"2017-12-18T17:31:49Z","git_url":"git://github.com/probtorch/pytorch.git","ssh_url":"git@github.com:probtorch/pytorch.git","clone_url":"https://github.com/probtorch/pytorch.git","svn_url":"https://github.com/probtorch/pytorch","homepage":"http://pytorch.org","size":20307,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":22,"license":null,"forks":0,"open_issues":22,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/probtorch/pytorch/pulls/35"},"html":{"href":"https://github.com/probtorch/pytorch/pull/35"},"issue":{"href":"https://api.github.com/repos/probtorch/pytorch/issues/35"},"comments":{"href":"https://api.github.com/repos/probtorch/pytorch/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/probtorch/pytorch/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/probtorch/pytorch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/probtorch/pytorch/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/probtorch/pytorch/statuses/10bd1e8477a937da9cd64a7ef0f644be0f98ebda"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"fritzo"}}