{"action":"created","comment":{"url":"https://api.github.com/repos/dmlc/tvm/pulls/comments/244106679","pull_request_review_id":188021918,"id":244106679,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDEwNjY3OQ==","diff_hunk":"@@ -0,0 +1,238 @@\n+===================\n+Relay's Type System\n+===================\n+\n+We briefly introduced types while detailing Relay's expression language\n+, but have not yet described its type system. Relay is\n+a statically typed and type-inferred language, allowing programs to\n+be fully typed while requiring just a few explicit type annotations.\n+\n+Static types are useful when performing compiler optimizations because they\n+communicate properties about the data a program manipulates, such as runtime\n+shape, data layout, and storage, without needing to run the program.\n+\n+Relay's type system features a form of *dependent typing* for shapes. That is, its type system keeps track of the shapes of tensors in a Relay program. Treating tensor\n+shapes as types allows Relay to perform more powerful reasoning at compile time;\n+in particular, Relay can statically reason about operations whose output shapes\n+vary based on the input shapes in complex ways. Casting shape inference as a type\n+inference problem allows Relay to infer the shapes of all tensors at compile time,\n+including in programs that use branching and function calls.\n+\n+Statically reasoning about shapes in this manner allows\n+Relay to be ahead-of-time compiled and provides much more information about\n+tensors for optimizations further in the compilation pipeline. Such optimizations\n+can be implemented as passes, which are Relay-to-Relay AST transformations, and\n+may use the inferred types (e.g., shape information) for making decisions about\n+program transformations. For instance, `src/relay/pass/fuse_ops.cc` gives","path":"docs/langref/relay_type.rst","position":26,"original_position":26,"commit_id":"d73a0bc2695c1076ee4f076fce0778ac68f2ef71","original_commit_id":"d73a0bc2695c1076ee4f076fce0778ac68f2ef71","user":{"login":"joshpoll","id":21694516,"node_id":"MDQ6VXNlcjIxNjk0NTE2","avatar_url":"https://avatars3.githubusercontent.com/u/21694516?v=4","gravatar_id":"","url":"https://api.github.com/users/joshpoll","html_url":"https://github.com/joshpoll","followers_url":"https://api.github.com/users/joshpoll/followers","following_url":"https://api.github.com/users/joshpoll/following{/other_user}","gists_url":"https://api.github.com/users/joshpoll/gists{/gist_id}","starred_url":"https://api.github.com/users/joshpoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshpoll/subscriptions","organizations_url":"https://api.github.com/users/joshpoll/orgs","repos_url":"https://api.github.com/users/joshpoll/repos","events_url":"https://api.github.com/users/joshpoll/events{/privacy}","received_events_url":"https://api.github.com/users/joshpoll/received_events","type":"User","site_admin":false},"body":"```suggestion\r\nprogram transformations. For instance, :code:`src/relay/pass/fuse_ops.cc` gives\r\n```","created_at":"2018-12-27T08:42:49Z","updated_at":"2018-12-27T08:58:07Z","html_url":"https://github.com/dmlc/tvm/pull/2232#discussion_r244106679","pull_request_url":"https://api.github.com/repos/dmlc/tvm/pulls/2232","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/comments/244106679"},"html":{"href":"https://github.com/dmlc/tvm/pull/2232#discussion_r244106679"},"pull_request":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/2232"}}},"pull_request":{"url":"https://api.github.com/repos/dmlc/tvm/pulls/2232","id":236022024,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2MDIyMDI0","html_url":"https://github.com/dmlc/tvm/pull/2232","diff_url":"https://github.com/dmlc/tvm/pull/2232.diff","patch_url":"https://github.com/dmlc/tvm/pull/2232.patch","issue_url":"https://api.github.com/repos/dmlc/tvm/issues/2232","number":2232,"state":"open","locked":false,"title":"[Relay][Docs] Relay Language Reference","user":{"login":"slyubomirsky","id":5624871,"node_id":"MDQ6VXNlcjU2MjQ4NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/5624871?v=4","gravatar_id":"","url":"https://api.github.com/users/slyubomirsky","html_url":"https://github.com/slyubomirsky","followers_url":"https://api.github.com/users/slyubomirsky/followers","following_url":"https://api.github.com/users/slyubomirsky/following{/other_user}","gists_url":"https://api.github.com/users/slyubomirsky/gists{/gist_id}","starred_url":"https://api.github.com/users/slyubomirsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slyubomirsky/subscriptions","organizations_url":"https://api.github.com/users/slyubomirsky/orgs","repos_url":"https://api.github.com/users/slyubomirsky/repos","events_url":"https://api.github.com/users/slyubomirsky/events{/privacy}","received_events_url":"https://api.github.com/users/slyubomirsky/received_events","type":"User","site_admin":false},"body":"Here is an attempt at revising @jroesch's old Relay documentation for #2212. There have been large changes to the language since the initial version of those comments (see the first commit, which preserved them), so there was a lot to adjust.\r\n\r\nOrganization of these documents was a tough point, so I would especially appreciate feedback on that. Any feedback on content and clarity (or other relevant points) would be welcome as well.\r\n\r\nOne change @tqchen recommended on the previous documentation PR was keeping Relay language reference docs in the same directory as the other language reference documents, so I did that here rather than having it in a subdirectory. I also would be interested in discussion as to whether this is a good format.","created_at":"2018-12-05T02:00:56Z","updated_at":"2018-12-27T08:58:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72882bbda20a025622258d5470e7828dce51ac28","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":858780915,"node_id":"MDU6TGFiZWw4NTg3ODA5MTU=","url":"https://api.github.com/repos/dmlc/tvm/labels/status:%20need%20review","name":"status: need review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dmlc/tvm/pulls/2232/commits","review_comments_url":"https://api.github.com/repos/dmlc/tvm/pulls/2232/comments","review_comment_url":"https://api.github.com/repos/dmlc/tvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmlc/tvm/issues/2232/comments","statuses_url":"https://api.github.com/repos/dmlc/tvm/statuses/d73a0bc2695c1076ee4f076fce0778ac68f2ef71","head":{"label":"slyubomirsky:relay-langref","ref":"relay-langref","sha":"d73a0bc2695c1076ee4f076fce0778ac68f2ef71","user":{"login":"slyubomirsky","id":5624871,"node_id":"MDQ6VXNlcjU2MjQ4NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/5624871?v=4","gravatar_id":"","url":"https://api.github.com/users/slyubomirsky","html_url":"https://github.com/slyubomirsky","followers_url":"https://api.github.com/users/slyubomirsky/followers","following_url":"https://api.github.com/users/slyubomirsky/following{/other_user}","gists_url":"https://api.github.com/users/slyubomirsky/gists{/gist_id}","starred_url":"https://api.github.com/users/slyubomirsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slyubomirsky/subscriptions","organizations_url":"https://api.github.com/users/slyubomirsky/orgs","repos_url":"https://api.github.com/users/slyubomirsky/repos","events_url":"https://api.github.com/users/slyubomirsky/events{/privacy}","received_events_url":"https://api.github.com/users/slyubomirsky/received_events","type":"User","site_admin":false},"repo":{"id":149190623,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkxOTA2MjM=","name":"tvm","full_name":"slyubomirsky/tvm","private":false,"owner":{"login":"slyubomirsky","id":5624871,"node_id":"MDQ6VXNlcjU2MjQ4NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/5624871?v=4","gravatar_id":"","url":"https://api.github.com/users/slyubomirsky","html_url":"https://github.com/slyubomirsky","followers_url":"https://api.github.com/users/slyubomirsky/followers","following_url":"https://api.github.com/users/slyubomirsky/following{/other_user}","gists_url":"https://api.github.com/users/slyubomirsky/gists{/gist_id}","starred_url":"https://api.github.com/users/slyubomirsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slyubomirsky/subscriptions","organizations_url":"https://api.github.com/users/slyubomirsky/orgs","repos_url":"https://api.github.com/users/slyubomirsky/repos","events_url":"https://api.github.com/users/slyubomirsky/events{/privacy}","received_events_url":"https://api.github.com/users/slyubomirsky/received_events","type":"User","site_admin":false},"html_url":"https://github.com/slyubomirsky/tvm","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","fork":true,"url":"https://api.github.com/repos/slyubomirsky/tvm","forks_url":"https://api.github.com/repos/slyubomirsky/tvm/forks","keys_url":"https://api.github.com/repos/slyubomirsky/tvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slyubomirsky/tvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slyubomirsky/tvm/teams","hooks_url":"https://api.github.com/repos/slyubomirsky/tvm/hooks","issue_events_url":"https://api.github.com/repos/slyubomirsky/tvm/issues/events{/number}","events_url":"https://api.github.com/repos/slyubomirsky/tvm/events","assignees_url":"https://api.github.com/repos/slyubomirsky/tvm/assignees{/user}","branches_url":"https://api.github.com/repos/slyubomirsky/tvm/branches{/branch}","tags_url":"https://api.github.com/repos/slyubomirsky/tvm/tags","blobs_url":"https://api.github.com/repos/slyubomirsky/tvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slyubomirsky/tvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slyubomirsky/tvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/slyubomirsky/tvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slyubomirsky/tvm/statuses/{sha}","languages_url":"https://api.github.com/repos/slyubomirsky/tvm/languages","stargazers_url":"https://api.github.com/repos/slyubomirsky/tvm/stargazers","contributors_url":"https://api.github.com/repos/slyubomirsky/tvm/contributors","subscribers_url":"https://api.github.com/repos/slyubomirsky/tvm/subscribers","subscription_url":"https://api.github.com/repos/slyubomirsky/tvm/subscription","commits_url":"https://api.github.com/repos/slyubomirsky/tvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/slyubomirsky/tvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/slyubomirsky/tvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/slyubomirsky/tvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/slyubomirsky/tvm/contents/{+path}","compare_url":"https://api.github.com/repos/slyubomirsky/tvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slyubomirsky/tvm/merges","archive_url":"https://api.github.com/repos/slyubomirsky/tvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slyubomirsky/tvm/downloads","issues_url":"https://api.github.com/repos/slyubomirsky/tvm/issues{/number}","pulls_url":"https://api.github.com/repos/slyubomirsky/tvm/pulls{/number}","milestones_url":"https://api.github.com/repos/slyubomirsky/tvm/milestones{/number}","notifications_url":"https://api.github.com/repos/slyubomirsky/tvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slyubomirsky/tvm/labels{/name}","releases_url":"https://api.github.com/repos/slyubomirsky/tvm/releases{/id}","deployments_url":"https://api.github.com/repos/slyubomirsky/tvm/deployments","created_at":"2018-09-17T21:31:25Z","updated_at":"2018-09-17T21:31:30Z","pushed_at":"2018-12-26T20:41:25Z","git_url":"git://github.com/slyubomirsky/tvm.git","ssh_url":"git@github.com:slyubomirsky/tvm.git","clone_url":"https://github.com/slyubomirsky/tvm.git","svn_url":"https://github.com/slyubomirsky/tvm","homepage":"https://tvm.ai","size":9482,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dmlc:master","ref":"master","sha":"93949456eedee33b1a39f59a30189bbce6732247","user":{"login":"dmlc","id":11508361,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA4MzYx","avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"repo":{"id":70746484,"node_id":"MDEwOlJlcG9zaXRvcnk3MDc0NjQ4NA==","name":"tvm","full_name":"dmlc/tvm","private":false,"owner":{"login":"dmlc","id":11508361,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA4MzYx","avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dmlc/tvm","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","fork":false,"url":"https://api.github.com/repos/dmlc/tvm","forks_url":"https://api.github.com/repos/dmlc/tvm/forks","keys_url":"https://api.github.com/repos/dmlc/tvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmlc/tvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmlc/tvm/teams","hooks_url":"https://api.github.com/repos/dmlc/tvm/hooks","issue_events_url":"https://api.github.com/repos/dmlc/tvm/issues/events{/number}","events_url":"https://api.github.com/repos/dmlc/tvm/events","assignees_url":"https://api.github.com/repos/dmlc/tvm/assignees{/user}","branches_url":"https://api.github.com/repos/dmlc/tvm/branches{/branch}","tags_url":"https://api.github.com/repos/dmlc/tvm/tags","blobs_url":"https://api.github.com/repos/dmlc/tvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmlc/tvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmlc/tvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmlc/tvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmlc/tvm/statuses/{sha}","languages_url":"https://api.github.com/repos/dmlc/tvm/languages","stargazers_url":"https://api.github.com/repos/dmlc/tvm/stargazers","contributors_url":"https://api.github.com/repos/dmlc/tvm/contributors","subscribers_url":"https://api.github.com/repos/dmlc/tvm/subscribers","subscription_url":"https://api.github.com/repos/dmlc/tvm/subscription","commits_url":"https://api.github.com/repos/dmlc/tvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmlc/tvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmlc/tvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmlc/tvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmlc/tvm/contents/{+path}","compare_url":"https://api.github.com/repos/dmlc/tvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmlc/tvm/merges","archive_url":"https://api.github.com/repos/dmlc/tvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmlc/tvm/downloads","issues_url":"https://api.github.com/repos/dmlc/tvm/issues{/number}","pulls_url":"https://api.github.com/repos/dmlc/tvm/pulls{/number}","milestones_url":"https://api.github.com/repos/dmlc/tvm/milestones{/number}","notifications_url":"https://api.github.com/repos/dmlc/tvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmlc/tvm/labels{/name}","releases_url":"https://api.github.com/repos/dmlc/tvm/releases{/id}","deployments_url":"https://api.github.com/repos/dmlc/tvm/deployments","created_at":"2016-10-12T22:20:28Z","updated_at":"2018-12-27T06:57:49Z","pushed_at":"2018-12-27T07:59:58Z","git_url":"git://github.com/dmlc/tvm.git","ssh_url":"git@github.com:dmlc/tvm.git","clone_url":"https://github.com/dmlc/tvm.git","svn_url":"https://github.com/dmlc/tvm","homepage":"https://tvm.ai","size":9263,"stargazers_count":2563,"watchers_count":2563,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":620,"mirror_url":null,"archived":false,"open_issues_count":78,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":620,"open_issues":78,"watchers":2563,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/2232"},"html":{"href":"https://github.com/dmlc/tvm/pull/2232"},"issue":{"href":"https://api.github.com/repos/dmlc/tvm/issues/2232"},"comments":{"href":"https://api.github.com/repos/dmlc/tvm/issues/2232/comments"},"review_comments":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/2232/comments"},"review_comment":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/2232/commits"},"statuses":{"href":"https://api.github.com/repos/dmlc/tvm/statuses/d73a0bc2695c1076ee4f076fce0778ac68f2ef71"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"joshpoll"}}