{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/2690","labels_url":"https://api.github.com/repos/Theano/Theano/issues/2690/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/2690/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/2690/events","html_url":"https://github.com/Theano/Theano/pull/2690","id":64795344,"number":2690,"title":"Add numpy.compress to theano.tensor","user":{"login":"swook","id":755922,"avatar_url":"https://avatars.githubusercontent.com/u/755922?v=3","gravatar_id":"","url":"https://api.github.com/users/swook","html_url":"https://github.com/swook","followers_url":"https://api.github.com/users/swook/followers","following_url":"https://api.github.com/users/swook/following{/other_user}","gists_url":"https://api.github.com/users/swook/gists{/gist_id}","starred_url":"https://api.github.com/users/swook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swook/subscriptions","organizations_url":"https://api.github.com/users/swook/orgs","repos_url":"https://api.github.com/users/swook/repos","events_url":"https://api.github.com/users/swook/events{/privacy}","received_events_url":"https://api.github.com/users/swook/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-27T16:17:21Z","updated_at":"2015-03-27T16:37:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Theano/Theano/pulls/2690","html_url":"https://github.com/Theano/Theano/pull/2690","diff_url":"https://github.com/Theano/Theano/pull/2690.diff","patch_url":"https://github.com/Theano/Theano/pull/2690.patch"},"body":"Added `numpy.compress` to the `theano.TensorVariable` interface, including unit tests.\r\nRef. issue #1080\r\n\r\nThere is one problem with the implementation at the moment... which I haven't been able to resolve on my own.\r\n\r\nNamely, it is that I cannot estimate the shape of outputs.\r\nThe input into `compress` is a vector of bools which represents whether an element/slice should be retained in the output, as well as the matrix being operated on.\r\nI cannot retrieve the dimension of the condition vector.\r\n\r\nAny advice/help would be appreciated."},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/87001517","html_url":"https://github.com/Theano/Theano/pull/2690#issuecomment-87001517","issue_url":"https://api.github.com/repos/Theano/Theano/issues/2690","id":87001517,"user":{"login":"lamblin","id":178249,"avatar_url":"https://avatars.githubusercontent.com/u/178249?v=3","gravatar_id":"","url":"https://api.github.com/users/lamblin","html_url":"https://github.com/lamblin","followers_url":"https://api.github.com/users/lamblin/followers","following_url":"https://api.github.com/users/lamblin/following{/other_user}","gists_url":"https://api.github.com/users/lamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/lamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamblin/subscriptions","organizations_url":"https://api.github.com/users/lamblin/orgs","repos_url":"https://api.github.com/users/lamblin/repos","events_url":"https://api.github.com/users/lamblin/events{/privacy}","received_events_url":"https://api.github.com/users/lamblin/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T16:37:43Z","updated_at":"2015-03-27T16:37:43Z","body":"Could it be simply implemented by calling `take(non_zeros(...))`?\r\nThat way, we would not have an additional Op, and the gradient wrt the input would already be implemented."}}