{"action":"created","issue":{"url":"https://api.github.com/repos/chewxy/gorgonia/issues/94","repository_url":"https://api.github.com/repos/chewxy/gorgonia","labels_url":"https://api.github.com/repos/chewxy/gorgonia/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/chewxy/gorgonia/issues/94/comments","events_url":"https://api.github.com/repos/chewxy/gorgonia/issues/94/events","html_url":"https://github.com/chewxy/gorgonia/issues/94","id":214740397,"number":94,"title":"Tensor AP stride","user":{"login":"kabaka0","id":10525989,"avatar_url":"https://avatars1.githubusercontent.com/u/10525989?v=3","gravatar_id":"","url":"https://api.github.com/users/kabaka0","html_url":"https://github.com/kabaka0","followers_url":"https://api.github.com/users/kabaka0/followers","following_url":"https://api.github.com/users/kabaka0/following{/other_user}","gists_url":"https://api.github.com/users/kabaka0/gists{/gist_id}","starred_url":"https://api.github.com/users/kabaka0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabaka0/subscriptions","organizations_url":"https://api.github.com/users/kabaka0/orgs","repos_url":"https://api.github.com/users/kabaka0/repos","events_url":"https://api.github.com/users/kabaka0/events{/privacy}","received_events_url":"https://api.github.com/users/kabaka0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-03-16T15:20:44Z","updated_at":"2017-03-16T21:53:54Z","closed_at":null,"body":"It is currently possible to set the shape of a tensor, but the stride is always calculated automatically (correct me if I am wrong). \r\n\r\nFor applications in which it is necessary to iterate through tensors of different shapes simultaneously, (say A with  shape [3,2]-> stride [2,1] and B with shape  [3,2,2]->stride[4,2,1]), it would be easy to do by temporarily setting the stride of A to [2,1,0] (and possible setting the shape to [3,2,2], depending on implementation). \r\n\r\nWhile you could achieve the same thing by playing around with parallel iterators and modulo-arithmetic on the returned locations, this might get complicated with complex tensors (such as transposed slices).\r\n\r\nIs there a solution to this kind of iteration as the package is currently constructed, and if not, to what extent would exposing stride break things?\r\n\r\nEdit: Having access to stride would also make it possible to do more complex slicing (we're currently limited to contiguous slices)."},"comment":{"url":"https://api.github.com/repos/chewxy/gorgonia/issues/comments/287202661","html_url":"https://github.com/chewxy/gorgonia/issues/94#issuecomment-287202661","issue_url":"https://api.github.com/repos/chewxy/gorgonia/issues/94","id":287202661,"user":{"login":"kabaka0","id":10525989,"avatar_url":"https://avatars1.githubusercontent.com/u/10525989?v=3","gravatar_id":"","url":"https://api.github.com/users/kabaka0","html_url":"https://github.com/kabaka0","followers_url":"https://api.github.com/users/kabaka0/followers","following_url":"https://api.github.com/users/kabaka0/following{/other_user}","gists_url":"https://api.github.com/users/kabaka0/gists{/gist_id}","starred_url":"https://api.github.com/users/kabaka0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabaka0/subscriptions","organizations_url":"https://api.github.com/users/kabaka0/orgs","repos_url":"https://api.github.com/users/kabaka0/repos","events_url":"https://api.github.com/users/kabaka0/events{/privacy}","received_events_url":"https://api.github.com/users/kabaka0/received_events","type":"User","site_admin":false},"created_at":"2017-03-16T21:53:54Z","updated_at":"2017-03-16T21:53:54Z","body":"Yup, that's exactly what I was looking for - your solution of directly editing the AP works, I'll be using it going forward.\r\n`a_ap2 := NewAP(Shape{3, 2, 2}, []int{2, 1, 0})\r\n`\r\nThe application is using one tensor to mask another (similar to numpy's masked arrays). In that instance you often need one dimension of one tensor to mask multiple dimensions of another, and so the 'mask' can have fewer dimensions than the data tensor. "}}
{"actor":{"display_login":"kabaka0"}}