{"comment":{"url":"https://api.github.com/repos/Arafatk/tensorflow.rb/comments/18286100","html_url":"https://github.com/Arafatk/tensorflow.rb/commit/04184ab7734360b74b06779e8444928c63bff342#commitcomment-18286100","id":18286100,"user":{"login":"zverok","id":129656,"avatar_url":"https://avatars.githubusercontent.com/u/129656?v=3","gravatar_id":"","url":"https://api.github.com/users/zverok","html_url":"https://github.com/zverok","followers_url":"https://api.github.com/users/zverok/followers","following_url":"https://api.github.com/users/zverok/following{/other_user}","gists_url":"https://api.github.com/users/zverok/gists{/gist_id}","starred_url":"https://api.github.com/users/zverok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zverok/subscriptions","organizations_url":"https://api.github.com/users/zverok/orgs","repos_url":"https://api.github.com/users/zverok/repos","events_url":"https://api.github.com/users/zverok/events{/privacy}","received_events_url":"https://api.github.com/users/zverok/received_events","type":"User","site_admin":false},"position":20,"line":20,"path":"lib/tensor.rb","commit_id":"04184ab7734360b74b06779e8444928c63bff342","created_at":"2016-07-18T16:35:33Z","updated_at":"2016-07-18T16:35:33Z","body":"Ruby's [Array](http://docs.ruby-lang.org/en/2.3.0/Array.html) class has a bunch of useful methods, like `map`, `select`, `reject` and so on, allowing more idiomatic code. In this case:\r\n```ruby\r\ndimensions = array.map { |i| TensorShapeProto::Dim.new(:size => i) }\r\n```\r\n\r\nAnother considerations (you can see them in my example):\r\n* you do not need `Tensorflow::` added to all methods internal to the `Tensorflow` namespace;\r\n* you should use new hashes style (`size: i`, not `:size => i` -- they are the same, but latter is more verbose and outdated as hell)"}}
{"actor":{"display_login":"zverok"}}