{"action":"created","comment":{"url":"https://api.github.com/repos/xamarin/TorchSharp/pulls/comments/234361017","pull_request_review_id":175997740,"id":234361017,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDM2MTAxNw==","diff_hunk":"@@ -0,0 +1,160 @@\n+<#@ template language=\"C#\" #>\n+<#@ assembly name=\"System.Core\" #>\n+<#@ import namespace=\"System.Linq\" #>\n+<#@ import namespace=\"System.Text\" #>\n+<#@ import namespace=\"System.Collections.Generic\" #>\n+using System;\n+using System.Linq;\n+using System.Numerics.Tensors;\n+using TorchSharp;\n+\n+namespace Torch.SNT \n+{\n+<#\n+foreach (var type in new [] { \n+    new { ApiName = \"Byte\", Storage = \"byte\", AccReal=\"long\" },\n+    new { ApiName = \"Short\", Storage = \"short\", AccReal=\"long\" },   \n+    new { ApiName = \"Int\", Storage = \"int\",  AccReal=\"long\"},\n+    new { ApiName = \"Long\", Storage = \"long\", AccReal=\"long\" },\n+    new { ApiName = \"Double\", Storage = \"double\", AccReal=\"double\" },\n+    new { ApiName = \"Float\", Storage = \"float\", AccReal=\"double\" },\n+     }) {\n+        string tname = type.ApiName;\n+#>\n+    /// <summary>\n+    ///   Wrapper class used to surface a Torch <#=tname#>Tensor as a System.Numerics DensorTensor of <#=tname.ToLower()#>\n+    /// </summary>\n+    public sealed class <#=tname#>TorchTensor : DenseTensor<<#=tname.ToLower()#>>","path":"SNT/TypeGenerator.tt","position":27,"original_position":27,"commit_id":"af787871375eb1aa3a540747b8eace4322773a55","original_commit_id":"5bebc7de68398149fedf4ac51519a08f31ce19e0","user":{"login":"motus","id":31380,"node_id":"MDQ6VXNlcjMxMzgw","avatar_url":"https://avatars1.githubusercontent.com/u/31380?v=4","gravatar_id":"","url":"https://api.github.com/users/motus","html_url":"https://github.com/motus","followers_url":"https://api.github.com/users/motus/followers","following_url":"https://api.github.com/users/motus/following{/other_user}","gists_url":"https://api.github.com/users/motus/gists{/gist_id}","starred_url":"https://api.github.com/users/motus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motus/subscriptions","organizations_url":"https://api.github.com/users/motus/orgs","repos_url":"https://api.github.com/users/motus/repos","events_url":"https://api.github.com/users/motus/events{/privacy}","received_events_url":"https://api.github.com/users/motus/received_events","type":"User","site_admin":false},"body":"FWIW, libtorch C++ API *is not* generic - that is, it has a single non-parameterized `at::Tensor` class with methods like `.type()`, `.device()`, `.is_sparse()` etc. All dispatching to the proper backend and function specialization happens at runtime in `Type` and `TensorImpl` classes. So maybe if even libtorch developers were not able to make the `Tensor` class parameterized - not even by the scalar type and in less restrictive C++ template system, we should not worry about it too much, either?\r\n\r\nP.S. That said, I'd be delighted to see a strongly typed tensor library for C# - ideally something in the spirit of Haskell's [HMatrix](http://dis.um.es/~alberto/hmatrix/hmatrix.html). The question is how much effort we want to put into it. (Maybe if we have a nice low-level API now, we can build an alternative strongly-typed parameterized API on top of it later?) Just thinking out loud.","created_at":"2018-11-16T22:01:24Z","updated_at":"2018-11-16T22:01:24Z","html_url":"https://github.com/xamarin/TorchSharp/pull/51#discussion_r234361017","pull_request_url":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/xamarin/TorchSharp/pulls/comments/234361017"},"html":{"href":"https://github.com/xamarin/TorchSharp/pull/51#discussion_r234361017"},"pull_request":{"href":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51"}},"in_reply_to_id":233617617},"pull_request":{"url":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51","id":228777597,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4Nzc3NTk3","html_url":"https://github.com/xamarin/TorchSharp/pull/51","diff_url":"https://github.com/xamarin/TorchSharp/pull/51.diff","patch_url":"https://github.com/xamarin/TorchSharp/pull/51.patch","issue_url":"https://api.github.com/repos/xamarin/TorchSharp/issues/51","number":51,"state":"open","locked":false,"title":"Dense SNT Wrapper for TorchTensors","user":{"login":"interesaaat","id":1534199,"node_id":"MDQ6VXNlcjE1MzQxOTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1534199?v=4","gravatar_id":"","url":"https://api.github.com/users/interesaaat","html_url":"https://github.com/interesaaat","followers_url":"https://api.github.com/users/interesaaat/followers","following_url":"https://api.github.com/users/interesaaat/following{/other_user}","gists_url":"https://api.github.com/users/interesaaat/gists{/gist_id}","starred_url":"https://api.github.com/users/interesaaat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interesaaat/subscriptions","organizations_url":"https://api.github.com/users/interesaaat/orgs","repos_url":"https://api.github.com/users/interesaaat/repos","events_url":"https://api.github.com/users/interesaaat/events{/privacy}","received_events_url":"https://api.github.com/users/interesaaat/received_events","type":"User","site_admin":false},"body":"This closes #3. We will need a different issue for the operators. This PR *only* extends the methods in the \r\n `DenseTensor<T>` class using Torch tensors as backends.","created_at":"2018-11-06T17:41:23Z","updated_at":"2018-11-16T22:01:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9912643cb1f18657a95e8fcd015f6657b86e169","assignee":null,"assignees":[],"requested_reviewers":[{"login":"motus","id":31380,"node_id":"MDQ6VXNlcjMxMzgw","avatar_url":"https://avatars1.githubusercontent.com/u/31380?v=4","gravatar_id":"","url":"https://api.github.com/users/motus","html_url":"https://github.com/motus","followers_url":"https://api.github.com/users/motus/followers","following_url":"https://api.github.com/users/motus/following{/other_user}","gists_url":"https://api.github.com/users/motus/gists{/gist_id}","starred_url":"https://api.github.com/users/motus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motus/subscriptions","organizations_url":"https://api.github.com/users/motus/orgs","repos_url":"https://api.github.com/users/motus/repos","events_url":"https://api.github.com/users/motus/events{/privacy}","received_events_url":"https://api.github.com/users/motus/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51/commits","review_comments_url":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51/comments","review_comment_url":"https://api.github.com/repos/xamarin/TorchSharp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xamarin/TorchSharp/issues/51/comments","statuses_url":"https://api.github.com/repos/xamarin/TorchSharp/statuses/af787871375eb1aa3a540747b8eace4322773a55","head":{"label":"interesaaat:issue3","ref":"issue3","sha":"af787871375eb1aa3a540747b8eace4322773a55","user":{"login":"interesaaat","id":1534199,"node_id":"MDQ6VXNlcjE1MzQxOTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1534199?v=4","gravatar_id":"","url":"https://api.github.com/users/interesaaat","html_url":"https://github.com/interesaaat","followers_url":"https://api.github.com/users/interesaaat/followers","following_url":"https://api.github.com/users/interesaaat/following{/other_user}","gists_url":"https://api.github.com/users/interesaaat/gists{/gist_id}","starred_url":"https://api.github.com/users/interesaaat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interesaaat/subscriptions","organizations_url":"https://api.github.com/users/interesaaat/orgs","repos_url":"https://api.github.com/users/interesaaat/repos","events_url":"https://api.github.com/users/interesaaat/events{/privacy}","received_events_url":"https://api.github.com/users/interesaaat/received_events","type":"User","site_admin":false},"repo":{"id":154566574,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ1NjY1NzQ=","name":"TorchSharp","full_name":"interesaaat/TorchSharp","private":false,"owner":{"login":"interesaaat","id":1534199,"node_id":"MDQ6VXNlcjE1MzQxOTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1534199?v=4","gravatar_id":"","url":"https://api.github.com/users/interesaaat","html_url":"https://github.com/interesaaat","followers_url":"https://api.github.com/users/interesaaat/followers","following_url":"https://api.github.com/users/interesaaat/following{/other_user}","gists_url":"https://api.github.com/users/interesaaat/gists{/gist_id}","starred_url":"https://api.github.com/users/interesaaat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interesaaat/subscriptions","organizations_url":"https://api.github.com/users/interesaaat/orgs","repos_url":"https://api.github.com/users/interesaaat/repos","events_url":"https://api.github.com/users/interesaaat/events{/privacy}","received_events_url":"https://api.github.com/users/interesaaat/received_events","type":"User","site_admin":false},"html_url":"https://github.com/interesaaat/TorchSharp","description":".NET bindings for the Pytorch engine","fork":true,"url":"https://api.github.com/repos/interesaaat/TorchSharp","forks_url":"https://api.github.com/repos/interesaaat/TorchSharp/forks","keys_url":"https://api.github.com/repos/interesaaat/TorchSharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/interesaaat/TorchSharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/interesaaat/TorchSharp/teams","hooks_url":"https://api.github.com/repos/interesaaat/TorchSharp/hooks","issue_events_url":"https://api.github.com/repos/interesaaat/TorchSharp/issues/events{/number}","events_url":"https://api.github.com/repos/interesaaat/TorchSharp/events","assignees_url":"https://api.github.com/repos/interesaaat/TorchSharp/assignees{/user}","branches_url":"https://api.github.com/repos/interesaaat/TorchSharp/branches{/branch}","tags_url":"https://api.github.com/repos/interesaaat/TorchSharp/tags","blobs_url":"https://api.github.com/repos/interesaaat/TorchSharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/interesaaat/TorchSharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/interesaaat/TorchSharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/interesaaat/TorchSharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/interesaaat/TorchSharp/statuses/{sha}","languages_url":"https://api.github.com/repos/interesaaat/TorchSharp/languages","stargazers_url":"https://api.github.com/repos/interesaaat/TorchSharp/stargazers","contributors_url":"https://api.github.com/repos/interesaaat/TorchSharp/contributors","subscribers_url":"https://api.github.com/repos/interesaaat/TorchSharp/subscribers","subscription_url":"https://api.github.com/repos/interesaaat/TorchSharp/subscription","commits_url":"https://api.github.com/repos/interesaaat/TorchSharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/interesaaat/TorchSharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/interesaaat/TorchSharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/interesaaat/TorchSharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/interesaaat/TorchSharp/contents/{+path}","compare_url":"https://api.github.com/repos/interesaaat/TorchSharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/interesaaat/TorchSharp/merges","archive_url":"https://api.github.com/repos/interesaaat/TorchSharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/interesaaat/TorchSharp/downloads","issues_url":"https://api.github.com/repos/interesaaat/TorchSharp/issues{/number}","pulls_url":"https://api.github.com/repos/interesaaat/TorchSharp/pulls{/number}","milestones_url":"https://api.github.com/repos/interesaaat/TorchSharp/milestones{/number}","notifications_url":"https://api.github.com/repos/interesaaat/TorchSharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/interesaaat/TorchSharp/labels{/name}","releases_url":"https://api.github.com/repos/interesaaat/TorchSharp/releases{/id}","deployments_url":"https://api.github.com/repos/interesaaat/TorchSharp/deployments","created_at":"2018-10-24T20:41:34Z","updated_at":"2018-10-24T20:41:36Z","pushed_at":"2018-11-15T01:42:16Z","git_url":"git://github.com/interesaaat/TorchSharp.git","ssh_url":"git@github.com:interesaaat/TorchSharp.git","clone_url":"https://github.com/interesaaat/TorchSharp.git","svn_url":"https://github.com/interesaaat/TorchSharp","homepage":null,"size":1616,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xamarin:master","ref":"master","sha":"d54cee2beeafc009aa46b0e28968dd6f09ffb627","user":{"login":"xamarin","id":790012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MDAxMg==","avatar_url":"https://avatars0.githubusercontent.com/u/790012?v=4","gravatar_id":"","url":"https://api.github.com/users/xamarin","html_url":"https://github.com/xamarin","followers_url":"https://api.github.com/users/xamarin/followers","following_url":"https://api.github.com/users/xamarin/following{/other_user}","gists_url":"https://api.github.com/users/xamarin/gists{/gist_id}","starred_url":"https://api.github.com/users/xamarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xamarin/subscriptions","organizations_url":"https://api.github.com/users/xamarin/orgs","repos_url":"https://api.github.com/users/xamarin/repos","events_url":"https://api.github.com/users/xamarin/events{/privacy}","received_events_url":"https://api.github.com/users/xamarin/received_events","type":"Organization","site_admin":false},"repo":{"id":152770407,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI3NzA0MDc=","name":"TorchSharp","full_name":"xamarin/TorchSharp","private":false,"owner":{"login":"xamarin","id":790012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MDAxMg==","avatar_url":"https://avatars0.githubusercontent.com/u/790012?v=4","gravatar_id":"","url":"https://api.github.com/users/xamarin","html_url":"https://github.com/xamarin","followers_url":"https://api.github.com/users/xamarin/followers","following_url":"https://api.github.com/users/xamarin/following{/other_user}","gists_url":"https://api.github.com/users/xamarin/gists{/gist_id}","starred_url":"https://api.github.com/users/xamarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xamarin/subscriptions","organizations_url":"https://api.github.com/users/xamarin/orgs","repos_url":"https://api.github.com/users/xamarin/repos","events_url":"https://api.github.com/users/xamarin/events{/privacy}","received_events_url":"https://api.github.com/users/xamarin/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/xamarin/TorchSharp","description":".NET bindings for the Pytorch engine","fork":false,"url":"https://api.github.com/repos/xamarin/TorchSharp","forks_url":"https://api.github.com/repos/xamarin/TorchSharp/forks","keys_url":"https://api.github.com/repos/xamarin/TorchSharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xamarin/TorchSharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xamarin/TorchSharp/teams","hooks_url":"https://api.github.com/repos/xamarin/TorchSharp/hooks","issue_events_url":"https://api.github.com/repos/xamarin/TorchSharp/issues/events{/number}","events_url":"https://api.github.com/repos/xamarin/TorchSharp/events","assignees_url":"https://api.github.com/repos/xamarin/TorchSharp/assignees{/user}","branches_url":"https://api.github.com/repos/xamarin/TorchSharp/branches{/branch}","tags_url":"https://api.github.com/repos/xamarin/TorchSharp/tags","blobs_url":"https://api.github.com/repos/xamarin/TorchSharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xamarin/TorchSharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xamarin/TorchSharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/xamarin/TorchSharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xamarin/TorchSharp/statuses/{sha}","languages_url":"https://api.github.com/repos/xamarin/TorchSharp/languages","stargazers_url":"https://api.github.com/repos/xamarin/TorchSharp/stargazers","contributors_url":"https://api.github.com/repos/xamarin/TorchSharp/contributors","subscribers_url":"https://api.github.com/repos/xamarin/TorchSharp/subscribers","subscription_url":"https://api.github.com/repos/xamarin/TorchSharp/subscription","commits_url":"https://api.github.com/repos/xamarin/TorchSharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/xamarin/TorchSharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/xamarin/TorchSharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/xamarin/TorchSharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/xamarin/TorchSharp/contents/{+path}","compare_url":"https://api.github.com/repos/xamarin/TorchSharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xamarin/TorchSharp/merges","archive_url":"https://api.github.com/repos/xamarin/TorchSharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xamarin/TorchSharp/downloads","issues_url":"https://api.github.com/repos/xamarin/TorchSharp/issues{/number}","pulls_url":"https://api.github.com/repos/xamarin/TorchSharp/pulls{/number}","milestones_url":"https://api.github.com/repos/xamarin/TorchSharp/milestones{/number}","notifications_url":"https://api.github.com/repos/xamarin/TorchSharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xamarin/TorchSharp/labels{/name}","releases_url":"https://api.github.com/repos/xamarin/TorchSharp/releases{/id}","deployments_url":"https://api.github.com/repos/xamarin/TorchSharp/deployments","created_at":"2018-10-12T15:20:45Z","updated_at":"2018-11-16T03:13:58Z","pushed_at":"2018-11-16T20:03:07Z","git_url":"git://github.com/xamarin/TorchSharp.git","ssh_url":"git@github.com:xamarin/TorchSharp.git","clone_url":"https://github.com/xamarin/TorchSharp.git","svn_url":"https://github.com/xamarin/TorchSharp","homepage":null,"size":1506,"stargazers_count":45,"watchers_count":45,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":9,"open_issues":16,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51"},"html":{"href":"https://github.com/xamarin/TorchSharp/pull/51"},"issue":{"href":"https://api.github.com/repos/xamarin/TorchSharp/issues/51"},"comments":{"href":"https://api.github.com/repos/xamarin/TorchSharp/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/xamarin/TorchSharp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xamarin/TorchSharp/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/xamarin/TorchSharp/statuses/af787871375eb1aa3a540747b8eace4322773a55"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"motus"}}