{"action":"created","comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments/59934851","id":59934851,"diff_hunk":"@@ -0,0 +1,214 @@\n+package main\n+\n+/* Copyright 2015 Google Inc. All Rights Reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+==============================================================================*/\n+\n+// A minimal but useful Go example showing how to load an Imagenet-style object\n+// recognition TensorFlow model, prepare input images for it, run them through\n+// the graph, and interpret the results.\n+//\n+// It's designed to have as few dependencies and be as clear as possible, so\n+// it's more verbose than it could be in production code. The errors maagement","path":"tensorflow/examples/label_image_go/main.go","position":23,"original_position":23,"commit_id":"210180befbd05694aa3285fef7d498bbd1be2dcc","original_commit_id":"210180befbd05694aa3285fef7d498bbd1be2dcc","user":{"login":"dave-andersen","id":827870,"avatar_url":"https://avatars.githubusercontent.com/u/827870?v=3","gravatar_id":"","url":"https://api.github.com/users/dave-andersen","html_url":"https://github.com/dave-andersen","followers_url":"https://api.github.com/users/dave-andersen/followers","following_url":"https://api.github.com/users/dave-andersen/following{/other_user}","gists_url":"https://api.github.com/users/dave-andersen/gists{/gist_id}","starred_url":"https://api.github.com/users/dave-andersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dave-andersen/subscriptions","organizations_url":"https://api.github.com/users/dave-andersen/orgs","repos_url":"https://api.github.com/users/dave-andersen/repos","events_url":"https://api.github.com/users/dave-andersen/events{/privacy}","received_events_url":"https://api.github.com/users/dave-andersen/received_events","type":"User","site_admin":false},"body":"typo:  errors maagement -> error management\r\n'had been' -> has been","created_at":"2016-04-15T20:17:24Z","updated_at":"2016-04-15T20:17:24Z","html_url":"https://github.com/tensorflow/tensorflow/pull/1771#discussion_r59934851","pull_request_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771","_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments/59934851"},"html":{"href":"https://github.com/tensorflow/tensorflow/pull/1771#discussion_r59934851"},"pull_request":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771"}}},"pull_request":{"url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771","id":65172733,"html_url":"https://github.com/tensorflow/tensorflow/pull/1771","diff_url":"https://github.com/tensorflow/tensorflow/pull/1771.diff","patch_url":"https://github.com/tensorflow/tensorflow/pull/1771.patch","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1771","number":1771,"state":"open","locked":false,"title":"Go API","user":{"login":"alonsovidales","id":1468785,"avatar_url":"https://avatars.githubusercontent.com/u/1468785?v=3","gravatar_id":"","url":"https://api.github.com/users/alonsovidales","html_url":"https://github.com/alonsovidales","followers_url":"https://api.github.com/users/alonsovidales/followers","following_url":"https://api.github.com/users/alonsovidales/following{/other_user}","gists_url":"https://api.github.com/users/alonsovidales/gists{/gist_id}","starred_url":"https://api.github.com/users/alonsovidales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonsovidales/subscriptions","organizations_url":"https://api.github.com/users/alonsovidales/orgs","repos_url":"https://api.github.com/users/alonsovidales/repos","events_url":"https://api.github.com/users/alonsovidales/events{/privacy}","received_events_url":"https://api.github.com/users/alonsovidales/received_events","type":"User","site_admin":false},"body":"Hello,\r\nDuring the last weeks I have been working on this implementation of the Go API. **This is still a work in progress**, I'm doing this PR just to show what I'm working on and to get feedback.\r\n\r\nI forked from https://github.com/tmc/tensorflow/tree/go_bindings where the bindings was implemented by Travis Cline. This Go library allows to interact with the tensors in an easy way from Go being able to create, populate and retrieve the content from the tensors. This library also provides the API for Graph generation from Go, create sessions, run this graphs and so on. The goal is to achieve the same functionality provided by the C++ API.\r\n\r\nIn order to show how the API works, I updated the label_image example with an implementation using the [Go API](https://github.com/alonsovidales/tensorflow/tree/go_bindings_tensors/tensorflow/examples/label_image_go) and I also updated the [tutorial](https://github.com/alonsovidales/tensorflow/blob/go_bindings_tensors/tensorflow/g3doc/tutorials/image_recognition/index.md#usage-with-the-go-api)\r\n\r\nI'm trying to keep all the code covered with tests, I still have to cover some corner cases and functionality like the data type recognition for the graph, etc.\r\nBy the moment the supported Tensor data types are:\r\n- TF_FLOAT\r\n- TF_DOUBLE\r\n- TF_INT32\r\n- TF_UINT8\r\n- TF_UINT32\r\n- TF_INT16\r\n- TF_INT8\r\n- TF_STRING\r\n- TF_INT64\r\n- TF_BOOL\r\nI'm planing to add support for TF_QINT* TF_BFLOAT16 and TF_COMPLEX soon.\r\n\r\nI have some doubts:\r\n - Would it be better to add the API docu as md in tensorflow/g3doc/ , or just with GoDoc it would be enough? Having the docu on the MarkDown files could be better for the people without too much experience on Go, but having the docu on GoDocs is going to be updated in an easiest way and the Go developers are more used to read the documentation on GoDoc format. We can also keep it in both places, or just add a link from the MarkDown docu to GoDoc.\r\n - In order to get the definition for all the available operations I'm loading this info from tensorflow/core/ops/ops.pbtxt . The problem is that I'm doing this [cp of the file from go gen](https://github.com/alonsovidales/tensorflow/blob/go_bindings_tensors/tensorflow/go/gen.go#L3). I think that this problem could be approached on three different ways:\r\n  - 1. Converting ops.pbtxt into a .go file: converting the content into a constant string we don't need to move this file, this option will remove this dependency, but if the file changes it will requiere to regenerate the libs that shouldn't be too much problem, we could even generate Go code for each operation so we don't need to parse the file and it would improve the performance.\r\n  - 2. Using something like the TF_GetOpList function used by Python in order to retrieve this info from the C++ API. This would add more dependencies from the Go to the C++ API, that is not a mayor issue but will requiere to prepare a new method or modify the original since TF_GetOpList depends on the Python libs.\r\n  - 3. As I'm doing right now, just copying the file. At least for a first iteration this could be a good option since it makes more easy to work with the code.\r\n - Regarding to the installation, I'm not sure if keep using \\\"go generate\\\" or Bazel, Go generate is more or less the standar for Go projects, but Bazel is what TensorFlow is using. I think that I'm going to change to Bazel so I can avoid things like [bazel from Go](https://github.com/alonsovidales/tensorflow/blob/go_bindings_tensors/tensorflow/go/gen.go#L1) but I'm not sure if this is the best approach.\r\n\r\nI would be really grateful if you could please take a look at the code and let me know your thoughts, what I'm missing, how can I improve it, etc.\r\n\r\nThanks!\r\n\r\nRelated ticket: #10 ","created_at":"2016-04-04T16:20:36Z","updated_at":"2016-04-15T20:17:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"382d94a074a47f78a75abd3bbcb37f29ee4fc614","assignee":{"login":"dave-andersen","id":827870,"avatar_url":"https://avatars.githubusercontent.com/u/827870?v=3","gravatar_id":"","url":"https://api.github.com/users/dave-andersen","html_url":"https://github.com/dave-andersen","followers_url":"https://api.github.com/users/dave-andersen/followers","following_url":"https://api.github.com/users/dave-andersen/following{/other_user}","gists_url":"https://api.github.com/users/dave-andersen/gists{/gist_id}","starred_url":"https://api.github.com/users/dave-andersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dave-andersen/subscriptions","organizations_url":"https://api.github.com/users/dave-andersen/orgs","repos_url":"https://api.github.com/users/dave-andersen/repos","events_url":"https://api.github.com/users/dave-andersen/events{/privacy}","received_events_url":"https://api.github.com/users/dave-andersen/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771/commits","review_comments_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771/comments","review_comment_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/1771/comments","statuses_url":"https://api.github.com/repos/tensorflow/tensorflow/statuses/210180befbd05694aa3285fef7d498bbd1be2dcc","head":{"label":"alonsovidales:go_bindings_tensors","ref":"go_bindings_tensors","sha":"210180befbd05694aa3285fef7d498bbd1be2dcc","user":{"login":"alonsovidales","id":1468785,"avatar_url":"https://avatars.githubusercontent.com/u/1468785?v=3","gravatar_id":"","url":"https://api.github.com/users/alonsovidales","html_url":"https://github.com/alonsovidales","followers_url":"https://api.github.com/users/alonsovidales/followers","following_url":"https://api.github.com/users/alonsovidales/following{/other_user}","gists_url":"https://api.github.com/users/alonsovidales/gists{/gist_id}","starred_url":"https://api.github.com/users/alonsovidales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonsovidales/subscriptions","organizations_url":"https://api.github.com/users/alonsovidales/orgs","repos_url":"https://api.github.com/users/alonsovidales/repos","events_url":"https://api.github.com/users/alonsovidales/events{/privacy}","received_events_url":"https://api.github.com/users/alonsovidales/received_events","type":"User","site_admin":false},"repo":{"id":54885358,"name":"tensorflow","full_name":"alonsovidales/tensorflow","owner":{"login":"alonsovidales","id":1468785,"avatar_url":"https://avatars.githubusercontent.com/u/1468785?v=3","gravatar_id":"","url":"https://api.github.com/users/alonsovidales","html_url":"https://github.com/alonsovidales","followers_url":"https://api.github.com/users/alonsovidales/followers","following_url":"https://api.github.com/users/alonsovidales/following{/other_user}","gists_url":"https://api.github.com/users/alonsovidales/gists{/gist_id}","starred_url":"https://api.github.com/users/alonsovidales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonsovidales/subscriptions","organizations_url":"https://api.github.com/users/alonsovidales/orgs","repos_url":"https://api.github.com/users/alonsovidales/repos","events_url":"https://api.github.com/users/alonsovidales/events{/privacy}","received_events_url":"https://api.github.com/users/alonsovidales/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alonsovidales/tensorflow","description":"Computation using data flow graphs for scalable machine learning","fork":true,"url":"https://api.github.com/repos/alonsovidales/tensorflow","forks_url":"https://api.github.com/repos/alonsovidales/tensorflow/forks","keys_url":"https://api.github.com/repos/alonsovidales/tensorflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alonsovidales/tensorflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alonsovidales/tensorflow/teams","hooks_url":"https://api.github.com/repos/alonsovidales/tensorflow/hooks","issue_events_url":"https://api.github.com/repos/alonsovidales/tensorflow/issues/events{/number}","events_url":"https://api.github.com/repos/alonsovidales/tensorflow/events","assignees_url":"https://api.github.com/repos/alonsovidales/tensorflow/assignees{/user}","branches_url":"https://api.github.com/repos/alonsovidales/tensorflow/branches{/branch}","tags_url":"https://api.github.com/repos/alonsovidales/tensorflow/tags","blobs_url":"https://api.github.com/repos/alonsovidales/tensorflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alonsovidales/tensorflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alonsovidales/tensorflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/alonsovidales/tensorflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alonsovidales/tensorflow/statuses/{sha}","languages_url":"https://api.github.com/repos/alonsovidales/tensorflow/languages","stargazers_url":"https://api.github.com/repos/alonsovidales/tensorflow/stargazers","contributors_url":"https://api.github.com/repos/alonsovidales/tensorflow/contributors","subscribers_url":"https://api.github.com/repos/alonsovidales/tensorflow/subscribers","subscription_url":"https://api.github.com/repos/alonsovidales/tensorflow/subscription","commits_url":"https://api.github.com/repos/alonsovidales/tensorflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/alonsovidales/tensorflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/alonsovidales/tensorflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/alonsovidales/tensorflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/alonsovidales/tensorflow/contents/{+path}","compare_url":"https://api.github.com/repos/alonsovidales/tensorflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alonsovidales/tensorflow/merges","archive_url":"https://api.github.com/repos/alonsovidales/tensorflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alonsovidales/tensorflow/downloads","issues_url":"https://api.github.com/repos/alonsovidales/tensorflow/issues{/number}","pulls_url":"https://api.github.com/repos/alonsovidales/tensorflow/pulls{/number}","milestones_url":"https://api.github.com/repos/alonsovidales/tensorflow/milestones{/number}","notifications_url":"https://api.github.com/repos/alonsovidales/tensorflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alonsovidales/tensorflow/labels{/name}","releases_url":"https://api.github.com/repos/alonsovidales/tensorflow/releases{/id}","deployments_url":"https://api.github.com/repos/alonsovidales/tensorflow/deployments","created_at":"2016-03-28T10:37:36Z","updated_at":"2016-04-01T21:27:01Z","pushed_at":"2016-04-15T11:16:15Z","git_url":"git://github.com/alonsovidales/tensorflow.git","ssh_url":"git@github.com:alonsovidales/tensorflow.git","clone_url":"https://github.com/alonsovidales/tensorflow.git","svn_url":"https://github.com/alonsovidales/tensorflow","homepage":"http://tensorflow.org","size":35122,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"tensorflow:master","ref":"master","sha":"d623811fc7e0f778cf60da9de668adfce5eee2da","user":{"login":"tensorflow","id":15658638,"avatar_url":"https://avatars.githubusercontent.com/u/15658638?v=3","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"repo":{"id":45717250,"name":"tensorflow","full_name":"tensorflow/tensorflow","owner":{"login":"tensorflow","id":15658638,"avatar_url":"https://avatars.githubusercontent.com/u/15658638?v=3","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tensorflow/tensorflow","description":"Computation using data flow graphs for scalable machine learning","fork":false,"url":"https://api.github.com/repos/tensorflow/tensorflow","forks_url":"https://api.github.com/repos/tensorflow/tensorflow/forks","keys_url":"https://api.github.com/repos/tensorflow/tensorflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tensorflow/tensorflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tensorflow/tensorflow/teams","hooks_url":"https://api.github.com/repos/tensorflow/tensorflow/hooks","issue_events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/events{/number}","events_url":"https://api.github.com/repos/tensorflow/tensorflow/events","assignees_url":"https://api.github.com/repos/tensorflow/tensorflow/assignees{/user}","branches_url":"https://api.github.com/repos/tensorflow/tensorflow/branches{/branch}","tags_url":"https://api.github.com/repos/tensorflow/tensorflow/tags","blobs_url":"https://api.github.com/repos/tensorflow/tensorflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tensorflow/tensorflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tensorflow/tensorflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/tensorflow/tensorflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tensorflow/tensorflow/statuses/{sha}","languages_url":"https://api.github.com/repos/tensorflow/tensorflow/languages","stargazers_url":"https://api.github.com/repos/tensorflow/tensorflow/stargazers","contributors_url":"https://api.github.com/repos/tensorflow/tensorflow/contributors","subscribers_url":"https://api.github.com/repos/tensorflow/tensorflow/subscribers","subscription_url":"https://api.github.com/repos/tensorflow/tensorflow/subscription","commits_url":"https://api.github.com/repos/tensorflow/tensorflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/tensorflow/tensorflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/tensorflow/tensorflow/contents/{+path}","compare_url":"https://api.github.com/repos/tensorflow/tensorflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tensorflow/tensorflow/merges","archive_url":"https://api.github.com/repos/tensorflow/tensorflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tensorflow/tensorflow/downloads","issues_url":"https://api.github.com/repos/tensorflow/tensorflow/issues{/number}","pulls_url":"https://api.github.com/repos/tensorflow/tensorflow/pulls{/number}","milestones_url":"https://api.github.com/repos/tensorflow/tensorflow/milestones{/number}","notifications_url":"https://api.github.com/repos/tensorflow/tensorflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/labels{/name}","releases_url":"https://api.github.com/repos/tensorflow/tensorflow/releases{/id}","deployments_url":"https://api.github.com/repos/tensorflow/tensorflow/deployments","created_at":"2015-11-07T01:19:20Z","updated_at":"2016-04-15T20:01:00Z","pushed_at":"2016-04-15T18:02:22Z","git_url":"git://github.com/tensorflow/tensorflow.git","ssh_url":"git@github.com:tensorflow/tensorflow.git","clone_url":"https://github.com/tensorflow/tensorflow.git","svn_url":"https://github.com/tensorflow/tensorflow","homepage":"http://tensorflow.org","size":138091,"stargazers_count":21584,"watchers_count":21584,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7794,"mirror_url":null,"open_issues_count":375,"forks":7794,"open_issues":375,"watchers":21584,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771"},"html":{"href":"https://github.com/tensorflow/tensorflow/pull/1771"},"issue":{"href":"https://api.github.com/repos/tensorflow/tensorflow/issues/1771"},"comments":{"href":"https://api.github.com/repos/tensorflow/tensorflow/issues/1771/comments"},"review_comments":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771/comments"},"review_comment":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tensorflow/tensorflow/pulls/1771/commits"},"statuses":{"href":"https://api.github.com/repos/tensorflow/tensorflow/statuses/210180befbd05694aa3285fef7d498bbd1be2dcc"}}}}