{"action":"created","issue":{"url":"https://api.github.com/repos/tiny-dnn/tiny-dnn/issues/411","repository_url":"https://api.github.com/repos/tiny-dnn/tiny-dnn","labels_url":"https://api.github.com/repos/tiny-dnn/tiny-dnn/issues/411/labels{/name}","comments_url":"https://api.github.com/repos/tiny-dnn/tiny-dnn/issues/411/comments","events_url":"https://api.github.com/repos/tiny-dnn/tiny-dnn/issues/411/events","html_url":"https://github.com/tiny-dnn/tiny-dnn/pull/411","id":190101372,"number":411,"title":"Tensor (reprise)","user":{"login":"pansk","id":1263535,"avatar_url":"https://avatars.githubusercontent.com/u/1263535?v=3","gravatar_id":"","url":"https://api.github.com/users/pansk","html_url":"https://github.com/pansk","followers_url":"https://api.github.com/users/pansk/followers","following_url":"https://api.github.com/users/pansk/following{/other_user}","gists_url":"https://api.github.com/users/pansk/gists{/gist_id}","starred_url":"https://api.github.com/users/pansk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pansk/subscriptions","organizations_url":"https://api.github.com/users/pansk/orgs","repos_url":"https://api.github.com/users/pansk/repos","events_url":"https://api.github.com/users/pansk/events{/privacy}","received_events_url":"https://api.github.com/users/pansk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-11-17T16:50:18Z","updated_at":"2016-11-19T15:37:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tiny-dnn/tiny-dnn/pulls/411","html_url":"https://github.com/tiny-dnn/tiny-dnn/pull/411","diff_url":"https://github.com/tiny-dnn/tiny-dnn/pull/411.diff","patch_url":"https://github.com/tiny-dnn/tiny-dnn/pull/411.patch"},"body":"Well, as usual, I made a mess with GIT, and apparently I can't easily push to @edgarriba's original PR.\r\n\r\nToday I reworked a bit @edgarriba's #400, I changed a bit the interface, added the lazy-allocation and lazy-movement of memory around, renamed accessor to host_ptr and host_at (to clarify they work on host memory), and implemented the generic functions for binary and unary host operations, element-wise and scalar, so it's now easier to implement functions such as add, sub, mul, div, exp, sqrt, ...\r\n\r\nI commented out linspace, if someone has a strong opinion about that, we can still get it back in."},"comment":{"url":"https://api.github.com/repos/tiny-dnn/tiny-dnn/issues/comments/261720798","html_url":"https://github.com/tiny-dnn/tiny-dnn/pull/411#issuecomment-261720798","issue_url":"https://api.github.com/repos/tiny-dnn/tiny-dnn/issues/411","id":261720798,"user":{"login":"beru","id":1131125,"avatar_url":"https://avatars.githubusercontent.com/u/1131125?v=3","gravatar_id":"","url":"https://api.github.com/users/beru","html_url":"https://github.com/beru","followers_url":"https://api.github.com/users/beru/followers","following_url":"https://api.github.com/users/beru/following{/other_user}","gists_url":"https://api.github.com/users/beru/gists{/gist_id}","starred_url":"https://api.github.com/users/beru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beru/subscriptions","organizations_url":"https://api.github.com/users/beru/orgs","repos_url":"https://api.github.com/users/beru/repos","events_url":"https://api.github.com/users/beru/events{/privacy}","received_events_url":"https://api.github.com/users/beru/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T15:37:20Z","updated_at":"2016-11-19T15:37:20Z","body":"> @beru instead of iterators, I'd rather like using slicing (a la valarray). Actually, when discussing with @edgarriba I also suggested we should have a look at the possibility of replacing the vector with a (possibly gsliced) valarray.\r\n\r\nI didn't know about std::valaray, And after reading [this](http://stackoverflow.com/questions/1602451/c-valarray-vs-vector) stackoverflow page, I think we should stick with std::vector or raw memory.\r\n\r\nTalking aboute implementing Iterator, I was just kidding. But it seems like current Tensor class does not provide end() like position of inner data. So it can be a bit troublesome.\r\n```\r\nconst U* end() const {\r\n    return mutable_host_data() + shape_[0] * shape_[1] * shape_[2] * shape_[3];\r\n}\r\nU* end() {\r\n    return mutable_host_data() + shape_[0] * shape_[1] * shape_[2] * shape_[3];\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"beru"}}