{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/17460","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/17460/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/17460/comments","events_url":"https://api.github.com/repos/apple/swift/issues/17460/events","html_url":"https://github.com/apple/swift/pull/17460","id":335126513,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2OTE4MjI2","number":17460,"title":"Add @TensorFlowGraph attribute to support user-defined accelerator-only functions","user":{"login":"rxwei","id":856507,"node_id":"MDQ6VXNlcjg1NjUwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/856507?v=4","gravatar_id":"","url":"https://api.github.com/users/rxwei","html_url":"https://github.com/rxwei","followers_url":"https://api.github.com/users/rxwei/followers","following_url":"https://api.github.com/users/rxwei/following{/other_user}","gists_url":"https://api.github.com/users/rxwei/gists{/gist_id}","starred_url":"https://api.github.com/users/rxwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxwei/subscriptions","organizations_url":"https://api.github.com/users/rxwei/orgs","repos_url":"https://api.github.com/users/rxwei/repos","events_url":"https://api.github.com/users/rxwei/events{/privacy}","received_events_url":"https://api.github.com/users/rxwei/received_events","type":"User","site_admin":false},"labels":[{"id":955546636,"node_id":"MDU6TGFiZWw5NTU1NDY2MzY=","url":"https://api.github.com/repos/apple/swift/labels/tensorflow","name":"tensorflow","color":"EF6C00","default":false}],"state":"open","locked":false,"assignee":{"login":"rxwei","id":856507,"node_id":"MDQ6VXNlcjg1NjUwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/856507?v=4","gravatar_id":"","url":"https://api.github.com/users/rxwei","html_url":"https://github.com/rxwei","followers_url":"https://api.github.com/users/rxwei/followers","following_url":"https://api.github.com/users/rxwei/following{/other_user}","gists_url":"https://api.github.com/users/rxwei/gists{/gist_id}","starred_url":"https://api.github.com/users/rxwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxwei/subscriptions","organizations_url":"https://api.github.com/users/rxwei/orgs","repos_url":"https://api.github.com/users/rxwei/repos","events_url":"https://api.github.com/users/rxwei/events{/privacy}","received_events_url":"https://api.github.com/users/rxwei/received_events","type":"User","site_admin":false},"assignees":[{"login":"rxwei","id":856507,"node_id":"MDQ6VXNlcjg1NjUwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/856507?v=4","gravatar_id":"","url":"https://api.github.com/users/rxwei","html_url":"https://github.com/rxwei","followers_url":"https://api.github.com/users/rxwei/followers","following_url":"https://api.github.com/users/rxwei/following{/other_user}","gists_url":"https://api.github.com/users/rxwei/gists{/gist_id}","starred_url":"https://api.github.com/users/rxwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxwei/subscriptions","organizations_url":"https://api.github.com/users/rxwei/orgs","repos_url":"https://api.github.com/users/rxwei/repos","events_url":"https://api.github.com/users/rxwei/events{/privacy}","received_events_url":"https://api.github.com/users/rxwei/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2018-06-23T19:57:13Z","updated_at":"2018-06-24T23:36:55Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/17460","html_url":"https://github.com/apple/swift/pull/17460","diff_url":"https://github.com/apple/swift/pull/17460.diff","patch_url":"https://github.com/apple/swift/pull/17460.patch"},"body":"This patch adds syntax and diagnostics for user-defined TensorFlow accelerator-only (`@convention(tensorflow)`) functions, which can be\r\n- used as an attribute to, `#tfop`,  the `__tfop_` builtin, and the `graph_op` instruction, and\r\n- exported as graph protos for non-Swift use (like Core ML and TensorFlow Python API)\r\n\r\nSuch functions must take and return tensor values or aggregates of tensor values, such as `TensorHandle<T>`, `Tensor<T>`, `ResourceHandle`, and `(Tensor<T>, VariantHandle)`.\r\n\r\nHere's a simple example:\r\n```swift\r\n@TensorFlowGraph\r\npublic func innout(_ x: Tensor<Float>) -> Tensor<Float> {\r\n  return x + 1\r\n}\r\n\r\npublic func takeTFFunction(_ f: @convention(tensorflow) (Tensor<Float>) -> Tensor<Float>) {\r\n  ...\r\n}\r\n\r\ntakeTFFunction(innout)\r\n```\r\n\r\nKnown TODOs: \r\n- Fix source location for host code diagnostics.\r\n- Diagnose host code before and after tensor start/end points.\r\n- Make the host-side function unreachable and wait till further support on the caller side, as suggested by @lattner ."},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/399798039","html_url":"https://github.com/apple/swift/pull/17460#issuecomment-399798039","issue_url":"https://api.github.com/repos/apple/swift/issues/17460","id":399798039,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTc5ODAzOQ==","user":{"login":"rxwei","id":856507,"node_id":"MDQ6VXNlcjg1NjUwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/856507?v=4","gravatar_id":"","url":"https://api.github.com/users/rxwei","html_url":"https://github.com/rxwei","followers_url":"https://api.github.com/users/rxwei/followers","following_url":"https://api.github.com/users/rxwei/following{/other_user}","gists_url":"https://api.github.com/users/rxwei/gists{/gist_id}","starred_url":"https://api.github.com/users/rxwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxwei/subscriptions","organizations_url":"https://api.github.com/users/rxwei/orgs","repos_url":"https://api.github.com/users/rxwei/repos","events_url":"https://api.github.com/users/rxwei/events{/privacy}","received_events_url":"https://api.github.com/users/rxwei/received_events","type":"User","site_admin":false},"created_at":"2018-06-24T23:36:55Z","updated_at":"2018-06-24T23:36:55Z","author_association":"COLLABORATOR","body":"@swift-ci please clean test tensorflow"}}
{"actor":{"display_login":"rxwei"}}