{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments/207382189","pull_request_review_id":142985818,"id":207382189,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzM4MjE4OQ==","diff_hunk":"@@ -0,0 +1,174 @@\n+\n+# Gotchas using NumPy in Apache MXNet\n+\n+The goal of this tutorial is to explain some common misconceptions about using [NumPy](http://www.numpy.org/) arrays in Apache MXNet. We are going to explain why you need to minimize or completely remove usage of NumPy from your Apache MXNet code. We also going to show how to minimize NumPy performance impact, when you have to use NumPy.\n+\n+## Asynchronous and non-blocking nature of Apache MXNet\n+\n+Instead of using NumPy arrays Apache MXNet offers its own array implementation named [NDArray](https://mxnet.incubator.apache.org/api/python/ndarray/ndarray.html). `NDArray API` was intentionally designed to be similar to `NumPy`, but there are differences.\n+\n+One key difference is in the way calculations are executed. Every `NDArray` manipulation in Apache MXNet is done in asynchronous, non-blocking way. That means, that when we write code like `c = a * b`, where both `a` and `b` are `NDArrays`, the function got pushed to the [Execution Engine](https://mxnet.incubator.apache.org/architecture/overview.html#execution-engine), which starts the calculation. The function immediately returns back, and the  user thread can continue execution, despite the fact that the calculation may not have been completed yet. \n+\n+`Execution Engine` builds computation graph which may reorder or combine some calculations, but it honors dependency order: if there are other manipulation with `c` done later in the code, the `Execution Engine` will start doing them once the result of `c` is available. We don't need to write callbacks to start execution of subsequent code - the `Execution Engine` is going to do it for us. ","path":"docs/tutorials/gluon/gotchas_numpy_in_mxnet.md","position":12,"original_position":12,"commit_id":"c66fd75d3a962c793fa7178ae9511258827677c6","original_commit_id":"c66fd75d3a962c793fa7178ae9511258827677c6","user":{"login":"larroy","id":928489,"node_id":"MDQ6VXNlcjkyODQ4OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/928489?v=4","gravatar_id":"","url":"https://api.github.com/users/larroy","html_url":"https://github.com/larroy","followers_url":"https://api.github.com/users/larroy/followers","following_url":"https://api.github.com/users/larroy/following{/other_user}","gists_url":"https://api.github.com/users/larroy/gists{/gist_id}","starred_url":"https://api.github.com/users/larroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larroy/subscriptions","organizations_url":"https://api.github.com/users/larroy/orgs","repos_url":"https://api.github.com/users/larroy/repos","events_url":"https://api.github.com/users/larroy/events{/privacy}","received_events_url":"https://api.github.com/users/larroy/received_events","type":"User","site_admin":false},"body":"builds *the* ","created_at":"2018-08-02T21:34:29Z","updated_at":"2018-08-02T21:34:29Z","html_url":"https://github.com/apache/incubator-mxnet/pull/12007#discussion_r207382189","pull_request_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments/207382189"},"html":{"href":"https://github.com/apache/incubator-mxnet/pull/12007#discussion_r207382189"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007","id":205840432,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1ODQwNDMy","html_url":"https://github.com/apache/incubator-mxnet/pull/12007","diff_url":"https://github.com/apache/incubator-mxnet/pull/12007.diff","patch_url":"https://github.com/apache/incubator-mxnet/pull/12007.patch","issue_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/12007","number":12007,"state":"open","locked":false,"title":"Add tutorial Gotchas using NumPy","user":{"login":"Ishitori","id":3286787,"node_id":"MDQ6VXNlcjMyODY3ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/3286787?v=4","gravatar_id":"","url":"https://api.github.com/users/Ishitori","html_url":"https://github.com/Ishitori","followers_url":"https://api.github.com/users/Ishitori/followers","following_url":"https://api.github.com/users/Ishitori/following{/other_user}","gists_url":"https://api.github.com/users/Ishitori/gists{/gist_id}","starred_url":"https://api.github.com/users/Ishitori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ishitori/subscriptions","organizations_url":"https://api.github.com/users/Ishitori/orgs","repos_url":"https://api.github.com/users/Ishitori/repos","events_url":"https://api.github.com/users/Ishitori/events{/privacy}","received_events_url":"https://api.github.com/users/Ishitori/received_events","type":"User","site_admin":false},"body":"## Description ##\r\nAdd tutorial Gotchas using NumPy. Explain about blocking calls and how to minimize the impact.\r\n\r\n## Checklist ##\r\n### Essentials ###\r\nPlease feel free to remove inapplicable items for your PR.\r\n- [X] Changes are complete (i.e. I finished coding on this PR)\r\n- [X] All changes have test coverage:\r\n- [X] Code is well-documented: \r\n- [X] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change\r\n\r\n### Changes ###\r\n- [X] Adds new tutorial","created_at":"2018-08-02T19:41:05Z","updated_at":"2018-08-02T21:34:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"233ffe5f0563be57fa43c9c5e840fe02eb3a1c23","assignee":null,"assignees":[],"requested_reviewers":[{"login":"szha","id":2626883,"node_id":"MDQ6VXNlcjI2MjY4ODM=","avatar_url":"https://avatars2.githubusercontent.com/u/2626883?v=4","gravatar_id":"","url":"https://api.github.com/users/szha","html_url":"https://github.com/szha","followers_url":"https://api.github.com/users/szha/followers","following_url":"https://api.github.com/users/szha/following{/other_user}","gists_url":"https://api.github.com/users/szha/gists{/gist_id}","starred_url":"https://api.github.com/users/szha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szha/subscriptions","organizations_url":"https://api.github.com/users/szha/orgs","repos_url":"https://api.github.com/users/szha/repos","events_url":"https://api.github.com/users/szha/events{/privacy}","received_events_url":"https://api.github.com/users/szha/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/12007/comments","statuses_url":"https://api.github.com/repos/apache/incubator-mxnet/statuses/c66fd75d3a962c793fa7178ae9511258827677c6","head":{"label":"Ishitori:numpy_in_mxnet","ref":"numpy_in_mxnet","sha":"c66fd75d3a962c793fa7178ae9511258827677c6","user":{"login":"Ishitori","id":3286787,"node_id":"MDQ6VXNlcjMyODY3ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/3286787?v=4","gravatar_id":"","url":"https://api.github.com/users/Ishitori","html_url":"https://github.com/Ishitori","followers_url":"https://api.github.com/users/Ishitori/followers","following_url":"https://api.github.com/users/Ishitori/following{/other_user}","gists_url":"https://api.github.com/users/Ishitori/gists{/gist_id}","starred_url":"https://api.github.com/users/Ishitori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ishitori/subscriptions","organizations_url":"https://api.github.com/users/Ishitori/orgs","repos_url":"https://api.github.com/users/Ishitori/repos","events_url":"https://api.github.com/users/Ishitori/events{/privacy}","received_events_url":"https://api.github.com/users/Ishitori/received_events","type":"User","site_admin":false},"repo":{"id":130133157,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAxMzMxNTc=","name":"incubator-mxnet","full_name":"Ishitori/incubator-mxnet","owner":{"login":"Ishitori","id":3286787,"node_id":"MDQ6VXNlcjMyODY3ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/3286787?v=4","gravatar_id":"","url":"https://api.github.com/users/Ishitori","html_url":"https://github.com/Ishitori","followers_url":"https://api.github.com/users/Ishitori/followers","following_url":"https://api.github.com/users/Ishitori/following{/other_user}","gists_url":"https://api.github.com/users/Ishitori/gists{/gist_id}","starred_url":"https://api.github.com/users/Ishitori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ishitori/subscriptions","organizations_url":"https://api.github.com/users/Ishitori/orgs","repos_url":"https://api.github.com/users/Ishitori/repos","events_url":"https://api.github.com/users/Ishitori/events{/privacy}","received_events_url":"https://api.github.com/users/Ishitori/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ishitori/incubator-mxnet","description":"Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more","fork":true,"url":"https://api.github.com/repos/Ishitori/incubator-mxnet","forks_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/forks","keys_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/teams","hooks_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/hooks","issue_events_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/issues/events{/number}","events_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/events","assignees_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/assignees{/user}","branches_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/branches{/branch}","tags_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/tags","blobs_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/statuses/{sha}","languages_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/languages","stargazers_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/stargazers","contributors_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/contributors","subscribers_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/subscribers","subscription_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/subscription","commits_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/contents/{+path}","compare_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/merges","archive_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/downloads","issues_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/issues{/number}","pulls_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/pulls{/number}","milestones_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/milestones{/number}","notifications_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/labels{/name}","releases_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/releases{/id}","deployments_url":"https://api.github.com/repos/Ishitori/incubator-mxnet/deployments","created_at":"2018-04-18T23:28:57Z","updated_at":"2018-06-05T18:35:16Z","pushed_at":"2018-08-02T21:02:54Z","git_url":"git://github.com/Ishitori/incubator-mxnet.git","ssh_url":"git@github.com:Ishitori/incubator-mxnet.git","clone_url":"https://github.com/Ishitori/incubator-mxnet.git","svn_url":"https://github.com/Ishitori/incubator-mxnet","homepage":"http://mxnet.io","size":39896,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"1bd9356b30ecde412663d0020ed769042cf456d6","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":34864402,"node_id":"MDEwOlJlcG9zaXRvcnkzNDg2NDQwMg==","name":"incubator-mxnet","full_name":"apache/incubator-mxnet","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-mxnet","description":"Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more","fork":false,"url":"https://api.github.com/repos/apache/incubator-mxnet","forks_url":"https://api.github.com/repos/apache/incubator-mxnet/forks","keys_url":"https://api.github.com/repos/apache/incubator-mxnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-mxnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-mxnet/teams","hooks_url":"https://api.github.com/repos/apache/incubator-mxnet/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-mxnet/events","assignees_url":"https://api.github.com/repos/apache/incubator-mxnet/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-mxnet/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-mxnet/tags","blobs_url":"https://api.github.com/repos/apache/incubator-mxnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-mxnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-mxnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-mxnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-mxnet/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-mxnet/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-mxnet/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-mxnet/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-mxnet/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-mxnet/subscription","commits_url":"https://api.github.com/repos/apache/incubator-mxnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-mxnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-mxnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-mxnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-mxnet/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-mxnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-mxnet/merges","archive_url":"https://api.github.com/repos/apache/incubator-mxnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-mxnet/downloads","issues_url":"https://api.github.com/repos/apache/incubator-mxnet/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-mxnet/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-mxnet/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-mxnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-mxnet/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-mxnet/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-mxnet/deployments","created_at":"2015-04-30T16:21:15Z","updated_at":"2018-08-02T21:03:28Z","pushed_at":"2018-08-02T21:27:28Z","git_url":"git://github.com/apache/incubator-mxnet.git","ssh_url":"git@github.com:apache/incubator-mxnet.git","clone_url":"https://github.com/apache/incubator-mxnet.git","svn_url":"https://github.com/apache/incubator-mxnet","homepage":"https://mxnet.apache.org","size":40096,"stargazers_count":14791,"watchers_count":14791,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5401,"mirror_url":null,"archived":false,"open_issues_count":965,"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":5401,"open_issues":965,"watchers":14791,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007"},"html":{"href":"https://github.com/apache/incubator-mxnet/pull/12007"},"issue":{"href":"https://api.github.com/repos/apache/incubator-mxnet/issues/12007"},"comments":{"href":"https://api.github.com/repos/apache/incubator-mxnet/issues/12007/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-mxnet/pulls/12007/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-mxnet/statuses/c66fd75d3a962c793fa7178ae9511258827677c6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"larroy"}}