{"action":"created","issue":{"url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/138","repository_url":"https://api.github.com/repos/arrayfire/arrayfire-rust","labels_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/138/comments","events_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/138/events","html_url":"https://github.com/arrayfire/arrayfire-rust/issues/138","id":232126113,"number":138,"title":"locate() does not implement borrow check?","user":{"login":"polarathene","id":5098581,"avatar_url":"https://avatars2.githubusercontent.com/u/5098581?v=3","gravatar_id":"","url":"https://api.github.com/users/polarathene","html_url":"https://github.com/polarathene","followers_url":"https://api.github.com/users/polarathene/followers","following_url":"https://api.github.com/users/polarathene/following{/other_user}","gists_url":"https://api.github.com/users/polarathene/gists{/gist_id}","starred_url":"https://api.github.com/users/polarathene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polarathene/subscriptions","organizations_url":"https://api.github.com/users/polarathene/orgs","repos_url":"https://api.github.com/users/polarathene/repos","events_url":"https://api.github.com/users/polarathene/events{/privacy}","received_events_url":"https://api.github.com/users/polarathene/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-30T02:10:48Z","updated_at":"2017-06-08T11:41:42Z","closed_at":null,"body":"See my comments on [this issue](https://github.com/arrayfire/arrayfire-rust/issues/124#issuecomment-304677872). I've provided a test sample to demonstrate slight change in when locate is used that provides an incorrect result or triggers a not so helpful panic depending on dims used. I've been told that making use of the borrow checker can inform users at compile time when the API is used incorrectly.\r\n\r\nBased on other errors/discrepencies with other AF functions causing confusion for me, I think many other functions would benefit from this?"},"comment":{"url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/comments/307078895","html_url":"https://github.com/arrayfire/arrayfire-rust/issues/138#issuecomment-307078895","issue_url":"https://api.github.com/repos/arrayfire/arrayfire-rust/issues/138","id":307078895,"user":{"login":"9prady9","id":3270458,"avatar_url":"https://avatars0.githubusercontent.com/u/3270458?v=3","gravatar_id":"","url":"https://api.github.com/users/9prady9","html_url":"https://github.com/9prady9","followers_url":"https://api.github.com/users/9prady9/followers","following_url":"https://api.github.com/users/9prady9/following{/other_user}","gists_url":"https://api.github.com/users/9prady9/gists{/gist_id}","starred_url":"https://api.github.com/users/9prady9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9prady9/subscriptions","organizations_url":"https://api.github.com/users/9prady9/orgs","repos_url":"https://api.github.com/users/9prady9/repos","events_url":"https://api.github.com/users/9prady9/events{/privacy}","received_events_url":"https://api.github.com/users/9prady9/received_events","type":"User","site_admin":false},"created_at":"2017-06-08T11:41:42Z","updated_at":"2017-06-08T11:41:42Z","body":"What do you mean by shifted the dimension ? \r\n\r\nMay be I confused you, I shall try to explain in detail once again. The dimension with which set_index is called will have an effect on how the output looks like. In this case, input array is considered 2D because there are > 1 elements along second dimension. The indexing operations will repeat elements if index array size is greater than the number of elements of array along given dimension. Lets take the example we have used to debug this issue.\r\n\r\nset_index is called with 0 as dim and input is of dims [1 3 1 1]. Since the input array has only one element along first(0th) dimension, for every index along that dimension, the only existing element is repeated because all indices point to the same element. Thus we see the following output\r\n```\r\n[2 3 1 1]\r\n         2          5          6 \r\n         2          5          6 \r\n```"}}
{"actor":{"display_login":"9prady9"}}