{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17387","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17387/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17387/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17387/events","html_url":"https://github.com/tensorflow/tensorflow/issues/17387","id":301918673,"number":17387,"title":"[feature request] add higher order function `scanr`","user":{"login":"shengc","id":940628,"avatar_url":"https://avatars1.githubusercontent.com/u/940628?v=4","gravatar_id":"","url":"https://api.github.com/users/shengc","html_url":"https://github.com/shengc","followers_url":"https://api.github.com/users/shengc/followers","following_url":"https://api.github.com/users/shengc/following{/other_user}","gists_url":"https://api.github.com/users/shengc/gists{/gist_id}","starred_url":"https://api.github.com/users/shengc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shengc/subscriptions","organizations_url":"https://api.github.com/users/shengc/orgs","repos_url":"https://api.github.com/users/shengc/repos","events_url":"https://api.github.com/users/shengc/events{/privacy}","received_events_url":"https://api.github.com/users/shengc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"shivaniag","id":16565716,"avatar_url":"https://avatars1.githubusercontent.com/u/16565716?v=4","gravatar_id":"","url":"https://api.github.com/users/shivaniag","html_url":"https://github.com/shivaniag","followers_url":"https://api.github.com/users/shivaniag/followers","following_url":"https://api.github.com/users/shivaniag/following{/other_user}","gists_url":"https://api.github.com/users/shivaniag/gists{/gist_id}","starred_url":"https://api.github.com/users/shivaniag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shivaniag/subscriptions","organizations_url":"https://api.github.com/users/shivaniag/orgs","repos_url":"https://api.github.com/users/shivaniag/repos","events_url":"https://api.github.com/users/shivaniag/events{/privacy}","received_events_url":"https://api.github.com/users/shivaniag/received_events","type":"User","site_admin":false},"assignees":[{"login":"shivaniag","id":16565716,"avatar_url":"https://avatars1.githubusercontent.com/u/16565716?v=4","gravatar_id":"","url":"https://api.github.com/users/shivaniag","html_url":"https://github.com/shivaniag","followers_url":"https://api.github.com/users/shivaniag/followers","following_url":"https://api.github.com/users/shivaniag/following{/other_user}","gists_url":"https://api.github.com/users/shivaniag/gists{/gist_id}","starred_url":"https://api.github.com/users/shivaniag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shivaniag/subscriptions","organizations_url":"https://api.github.com/users/shivaniag/orgs","repos_url":"https://api.github.com/users/shivaniag/repos","events_url":"https://api.github.com/users/shivaniag/events{/privacy}","received_events_url":"https://api.github.com/users/shivaniag/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-03-02T21:59:46Z","updated_at":"2018-04-25T18:57:06Z","closed_at":null,"author_association":"NONE","body":"Have I written custom code: yes\r\nOS Platform and Distribution: OSX 10.11.6\r\nTensorFlow installed from: conda-forge\r\nTensorFlow version: 1.5\r\nBazel version: N.A\r\nCUDA/cuDNN version: N/A (CPU only)\r\nGPU model and memory (CPU only)\r\nExact command to reproduce: N/A\r\n\r\nDescription:\r\nTensorFlow has `foldl` which folds the array from first to last, and `foldr` which folds the array from last to first. It also has `scan` which returns the trace of `foldl`, but there is no `scanr` that returns the trace of `foldr`. \r\n\r\n`scanr` can be proven useful sometimes. Look at the following snippet that is sampled from my implementation of a [crf lstm sequence tagger](https://github.com/shengc/tf-lstm-crf-tagger/blob/master/lstm-crf-tagger.ipynb).\r\n\r\n```python\r\nreverse_path = tf.scan(step_path, tf.reverse(backpointers, axis=[0]), initializer=best_tag_id, back_prop=False)\r\nbest_path = tf.concat([tf.reverse(reverse_path, axis=[0])[1:], [best_tag_id]], axis=0)\r\n```\r\n\r\nI have to call `tf.reverse` twice, just because TensorFlow only provides `scan` from first to last.\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/384397105","html_url":"https://github.com/tensorflow/tensorflow/issues/17387#issuecomment-384397105","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17387","id":384397105,"user":{"login":"tensorflowbutler","id":28546240,"avatar_url":"https://avatars2.githubusercontent.com/u/28546240?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflowbutler","html_url":"https://github.com/tensorflowbutler","followers_url":"https://api.github.com/users/tensorflowbutler/followers","following_url":"https://api.github.com/users/tensorflowbutler/following{/other_user}","gists_url":"https://api.github.com/users/tensorflowbutler/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflowbutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflowbutler/subscriptions","organizations_url":"https://api.github.com/users/tensorflowbutler/orgs","repos_url":"https://api.github.com/users/tensorflowbutler/repos","events_url":"https://api.github.com/users/tensorflowbutler/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflowbutler/received_events","type":"User","site_admin":false},"created_at":"2018-04-25T18:57:06Z","updated_at":"2018-04-25T18:57:06Z","author_association":"MEMBER","body":"Nagging Assignee @shivaniag: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly."}}
{"actor":{"display_login":"tensorflowbutler"}}