{"action":"created","comment":{"url":"https://api.github.com/repos/arrayfire/arrayfire/pulls/comments/208083370","pull_request_review_id":143822792,"id":208083370,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODA4MzM3MA==","diff_hunk":"@@ -512,12 +513,33 @@ std::ostream& operator<<(std::ostream& os, af::dtype type) {\n     return os << name;\n }\n \n+// Overloading unary + op is needed to make unsigned char values printable\n+//  as numbers\n+\n+template<typename T>\n+std::string operator+(const T& val) {\n+    std::ostringstream os;\n+    os << +val;\n+    return os.str();\n+}\n+\n+template<>\n+std::string operator+(const af::cfloat& val) {","path":"test/testHelpers.hpp","position":23,"original_position":23,"commit_id":"35c36c24a6d76aab82cd3633782d58afbcaac363","original_commit_id":"35c36c24a6d76aab82cd3633782d58afbcaac363","user":{"login":"mark-poscablo","id":19368448,"node_id":"MDQ6VXNlcjE5MzY4NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19368448?v=4","gravatar_id":"","url":"https://api.github.com/users/mark-poscablo","html_url":"https://github.com/mark-poscablo","followers_url":"https://api.github.com/users/mark-poscablo/followers","following_url":"https://api.github.com/users/mark-poscablo/following{/other_user}","gists_url":"https://api.github.com/users/mark-poscablo/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-poscablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-poscablo/subscriptions","organizations_url":"https://api.github.com/users/mark-poscablo/orgs","repos_url":"https://api.github.com/users/mark-poscablo/repos","events_url":"https://api.github.com/users/mark-poscablo/events{/privacy}","received_events_url":"https://api.github.com/users/mark-poscablo/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2018-08-07T02:38:24Z","updated_at":"2018-08-07T02:38:24Z","html_url":"https://github.com/arrayfire/arrayfire/pull/2263#discussion_r208083370","pull_request_url":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/arrayfire/arrayfire/pulls/comments/208083370"},"html":{"href":"https://github.com/arrayfire/arrayfire/pull/2263#discussion_r208083370"},"pull_request":{"href":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263"}},"in_reply_to_id":208061712},"pull_request":{"url":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263","id":206497570,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDk3NTcw","html_url":"https://github.com/arrayfire/arrayfire/pull/2263","diff_url":"https://github.com/arrayfire/arrayfire/pull/2263.diff","patch_url":"https://github.com/arrayfire/arrayfire/pull/2263.patch","issue_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/2263","number":2263,"state":"open","locked":false,"title":"Assert macros: minimize spacings between values in context window","user":{"login":"mark-poscablo","id":19368448,"node_id":"MDQ6VXNlcjE5MzY4NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19368448?v=4","gravatar_id":"","url":"https://api.github.com/users/mark-poscablo","html_url":"https://github.com/mark-poscablo","followers_url":"https://api.github.com/users/mark-poscablo/followers","following_url":"https://api.github.com/users/mark-poscablo/following{/other_user}","gists_url":"https://api.github.com/users/mark-poscablo/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-poscablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-poscablo/subscriptions","organizations_url":"https://api.github.com/users/mark-poscablo/orgs","repos_url":"https://api.github.com/users/mark-poscablo/repos","events_url":"https://api.github.com/users/mark-poscablo/events{/privacy}","received_events_url":"https://api.github.com/users/mark-poscablo/received_events","type":"User","site_admin":false},"body":"Following up on #2257, the spacing between consecutive values in the context window (when values differ at some point) has been reduced in this change. It was previously hardcoded as 10 space chars - now, the output field width is the maximum between the string lengths of the dim0 position, the output value, and the reference value, so any unnecessary spaces are removed.\r\n\r\nThis also fixes a bug when u8 (unsigned char) is used. Previously, the context displays the character representation of the value. It's fixed now so it displays the number representation instead.\r\n\r\nIn addtion, this also changes the implementation of `ravelIdx()` from an explicit multiply-and-accumulate to using `std::inner_product()`\r\n\r\nHere's a sample error message:\r\n```\r\nVALUE DIFFERS at (100):\r\nViewing slice (95:105), dims are (200)\r\n        95     96     97     98     99     [100]    101    102    103    104    105    \r\n out: { 2.2345 2.2345 2.2345 2.2345 2.2345 [1]      2.2345 2.2345 2.2345 2.2345 2.2345 }\r\ngold: { 2.2345 2.2345 2.2345 2.2345 2.2345 [2.2345] 2.2345 2.2345 2.2345 2.2345 2.2345 }\r\n  Actual diff: 1.2344999313354492\r\nExpected diff: 0.0010000000474974513\r\n```\r\nUsing \"normal\" equality for u8 (unsigned char) type:\r\n```\r\nVALUE DIFFERS at (125, 82):\r\nViewing slice (120:130, 82), dims are (200, 100)\r\n        120 121 122 123 124 [125] 126 127 128 129 130 \r\n out: { 173 50  245 245 75  [2]   10  10  76  239 188 }\r\ngold: { 173 50  245 245 75  [138] 10  10  76  239 188 }\r\n```\r\nAnd using c32 (complex float):\r\n```\r\nVALUE DIFFERS at (3, 0, 1, 2):\r\nViewing slice (0:8, 0, 1, 2), dims are (200, 5, 4, 3)\r\n        0                    1                     2                      [3]                    4                    5                    6                    7                    8                    \r\n out: { (0.478302, 0.220143) (0.0281664, 0.524339) (0.0122882, 0.0084334) [(2, 0)]               (0.181692, 0.274965) (0.372441, 0.669381) (0.022832, 0.717884) (0.373681, 0.060741) (0.824519, 0.816422) }\r\ngold: { (0.478302, 0.220143) (0.0281664, 0.524339) (0.0122882, 0.0084334) [(0.024198, 0.999783)] (0.181692, 0.274965) (0.372441, 0.669381) (0.022832, 0.717884) (0.373681, 0.060741) (0.824519, 0.816422) }\r\n``` ","created_at":"2018-08-06T19:44:06Z","updated_at":"2018-08-07T02:38:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b15c0833aaafd23acdf94137a49d1bfb32169a92","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":142971824,"node_id":"MDU6TGFiZWwxNDI5NzE4MjQ=","url":"https://api.github.com/repos/arrayfire/arrayfire/labels/test","name":"test","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263/commits","review_comments_url":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263/comments","review_comment_url":"https://api.github.com/repos/arrayfire/arrayfire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/2263/comments","statuses_url":"https://api.github.com/repos/arrayfire/arrayfire/statuses/35c36c24a6d76aab82cd3633782d58afbcaac363","head":{"label":"mark-poscablo:fix-context-spacings","ref":"fix-context-spacings","sha":"35c36c24a6d76aab82cd3633782d58afbcaac363","user":{"login":"mark-poscablo","id":19368448,"node_id":"MDQ6VXNlcjE5MzY4NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19368448?v=4","gravatar_id":"","url":"https://api.github.com/users/mark-poscablo","html_url":"https://github.com/mark-poscablo","followers_url":"https://api.github.com/users/mark-poscablo/followers","following_url":"https://api.github.com/users/mark-poscablo/following{/other_user}","gists_url":"https://api.github.com/users/mark-poscablo/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-poscablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-poscablo/subscriptions","organizations_url":"https://api.github.com/users/mark-poscablo/orgs","repos_url":"https://api.github.com/users/mark-poscablo/repos","events_url":"https://api.github.com/users/mark-poscablo/events{/privacy}","received_events_url":"https://api.github.com/users/mark-poscablo/received_events","type":"User","site_admin":false},"repo":{"id":132472748,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI0NzI3NDg=","name":"arrayfire","full_name":"mark-poscablo/arrayfire","owner":{"login":"mark-poscablo","id":19368448,"node_id":"MDQ6VXNlcjE5MzY4NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19368448?v=4","gravatar_id":"","url":"https://api.github.com/users/mark-poscablo","html_url":"https://github.com/mark-poscablo","followers_url":"https://api.github.com/users/mark-poscablo/followers","following_url":"https://api.github.com/users/mark-poscablo/following{/other_user}","gists_url":"https://api.github.com/users/mark-poscablo/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-poscablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-poscablo/subscriptions","organizations_url":"https://api.github.com/users/mark-poscablo/orgs","repos_url":"https://api.github.com/users/mark-poscablo/repos","events_url":"https://api.github.com/users/mark-poscablo/events{/privacy}","received_events_url":"https://api.github.com/users/mark-poscablo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mark-poscablo/arrayfire","description":"ArrayFire: a general purpose GPU library.","fork":true,"url":"https://api.github.com/repos/mark-poscablo/arrayfire","forks_url":"https://api.github.com/repos/mark-poscablo/arrayfire/forks","keys_url":"https://api.github.com/repos/mark-poscablo/arrayfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mark-poscablo/arrayfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mark-poscablo/arrayfire/teams","hooks_url":"https://api.github.com/repos/mark-poscablo/arrayfire/hooks","issue_events_url":"https://api.github.com/repos/mark-poscablo/arrayfire/issues/events{/number}","events_url":"https://api.github.com/repos/mark-poscablo/arrayfire/events","assignees_url":"https://api.github.com/repos/mark-poscablo/arrayfire/assignees{/user}","branches_url":"https://api.github.com/repos/mark-poscablo/arrayfire/branches{/branch}","tags_url":"https://api.github.com/repos/mark-poscablo/arrayfire/tags","blobs_url":"https://api.github.com/repos/mark-poscablo/arrayfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mark-poscablo/arrayfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mark-poscablo/arrayfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/mark-poscablo/arrayfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mark-poscablo/arrayfire/statuses/{sha}","languages_url":"https://api.github.com/repos/mark-poscablo/arrayfire/languages","stargazers_url":"https://api.github.com/repos/mark-poscablo/arrayfire/stargazers","contributors_url":"https://api.github.com/repos/mark-poscablo/arrayfire/contributors","subscribers_url":"https://api.github.com/repos/mark-poscablo/arrayfire/subscribers","subscription_url":"https://api.github.com/repos/mark-poscablo/arrayfire/subscription","commits_url":"https://api.github.com/repos/mark-poscablo/arrayfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/mark-poscablo/arrayfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/mark-poscablo/arrayfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/mark-poscablo/arrayfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/mark-poscablo/arrayfire/contents/{+path}","compare_url":"https://api.github.com/repos/mark-poscablo/arrayfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mark-poscablo/arrayfire/merges","archive_url":"https://api.github.com/repos/mark-poscablo/arrayfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mark-poscablo/arrayfire/downloads","issues_url":"https://api.github.com/repos/mark-poscablo/arrayfire/issues{/number}","pulls_url":"https://api.github.com/repos/mark-poscablo/arrayfire/pulls{/number}","milestones_url":"https://api.github.com/repos/mark-poscablo/arrayfire/milestones{/number}","notifications_url":"https://api.github.com/repos/mark-poscablo/arrayfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mark-poscablo/arrayfire/labels{/name}","releases_url":"https://api.github.com/repos/mark-poscablo/arrayfire/releases{/id}","deployments_url":"https://api.github.com/repos/mark-poscablo/arrayfire/deployments","created_at":"2018-05-07T14:30:30Z","updated_at":"2018-08-02T21:07:29Z","pushed_at":"2018-08-06T20:51:43Z","git_url":"git://github.com/mark-poscablo/arrayfire.git","ssh_url":"git@github.com:mark-poscablo/arrayfire.git","clone_url":"https://github.com/mark-poscablo/arrayfire.git","svn_url":"https://github.com/mark-poscablo/arrayfire","homepage":"https://arrayfire.com","size":11787,"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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"arrayfire:master","ref":"master","sha":"daa8e8bc1c834e6a1d7fe272994616e5899b1f92","user":{"login":"arrayfire","id":5395442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzOTU0NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/5395442?v=4","gravatar_id":"","url":"https://api.github.com/users/arrayfire","html_url":"https://github.com/arrayfire","followers_url":"https://api.github.com/users/arrayfire/followers","following_url":"https://api.github.com/users/arrayfire/following{/other_user}","gists_url":"https://api.github.com/users/arrayfire/gists{/gist_id}","starred_url":"https://api.github.com/users/arrayfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arrayfire/subscriptions","organizations_url":"https://api.github.com/users/arrayfire/orgs","repos_url":"https://api.github.com/users/arrayfire/repos","events_url":"https://api.github.com/users/arrayfire/events{/privacy}","received_events_url":"https://api.github.com/users/arrayfire/received_events","type":"Organization","site_admin":false},"repo":{"id":25889802,"node_id":"MDEwOlJlcG9zaXRvcnkyNTg4OTgwMg==","name":"arrayfire","full_name":"arrayfire/arrayfire","owner":{"login":"arrayfire","id":5395442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzOTU0NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/5395442?v=4","gravatar_id":"","url":"https://api.github.com/users/arrayfire","html_url":"https://github.com/arrayfire","followers_url":"https://api.github.com/users/arrayfire/followers","following_url":"https://api.github.com/users/arrayfire/following{/other_user}","gists_url":"https://api.github.com/users/arrayfire/gists{/gist_id}","starred_url":"https://api.github.com/users/arrayfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arrayfire/subscriptions","organizations_url":"https://api.github.com/users/arrayfire/orgs","repos_url":"https://api.github.com/users/arrayfire/repos","events_url":"https://api.github.com/users/arrayfire/events{/privacy}","received_events_url":"https://api.github.com/users/arrayfire/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arrayfire/arrayfire","description":"ArrayFire: a general purpose GPU library.","fork":false,"url":"https://api.github.com/repos/arrayfire/arrayfire","forks_url":"https://api.github.com/repos/arrayfire/arrayfire/forks","keys_url":"https://api.github.com/repos/arrayfire/arrayfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arrayfire/arrayfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arrayfire/arrayfire/teams","hooks_url":"https://api.github.com/repos/arrayfire/arrayfire/hooks","issue_events_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/events{/number}","events_url":"https://api.github.com/repos/arrayfire/arrayfire/events","assignees_url":"https://api.github.com/repos/arrayfire/arrayfire/assignees{/user}","branches_url":"https://api.github.com/repos/arrayfire/arrayfire/branches{/branch}","tags_url":"https://api.github.com/repos/arrayfire/arrayfire/tags","blobs_url":"https://api.github.com/repos/arrayfire/arrayfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arrayfire/arrayfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arrayfire/arrayfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/arrayfire/arrayfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arrayfire/arrayfire/statuses/{sha}","languages_url":"https://api.github.com/repos/arrayfire/arrayfire/languages","stargazers_url":"https://api.github.com/repos/arrayfire/arrayfire/stargazers","contributors_url":"https://api.github.com/repos/arrayfire/arrayfire/contributors","subscribers_url":"https://api.github.com/repos/arrayfire/arrayfire/subscribers","subscription_url":"https://api.github.com/repos/arrayfire/arrayfire/subscription","commits_url":"https://api.github.com/repos/arrayfire/arrayfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/arrayfire/arrayfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/arrayfire/arrayfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/arrayfire/arrayfire/contents/{+path}","compare_url":"https://api.github.com/repos/arrayfire/arrayfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arrayfire/arrayfire/merges","archive_url":"https://api.github.com/repos/arrayfire/arrayfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arrayfire/arrayfire/downloads","issues_url":"https://api.github.com/repos/arrayfire/arrayfire/issues{/number}","pulls_url":"https://api.github.com/repos/arrayfire/arrayfire/pulls{/number}","milestones_url":"https://api.github.com/repos/arrayfire/arrayfire/milestones{/number}","notifications_url":"https://api.github.com/repos/arrayfire/arrayfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arrayfire/arrayfire/labels{/name}","releases_url":"https://api.github.com/repos/arrayfire/arrayfire/releases{/id}","deployments_url":"https://api.github.com/repos/arrayfire/arrayfire/deployments","created_at":"2014-10-28T20:58:33Z","updated_at":"2018-08-06T11:00:44Z","pushed_at":"2018-08-06T20:51:45Z","git_url":"git://github.com/arrayfire/arrayfire.git","ssh_url":"git@github.com:arrayfire/arrayfire.git","clone_url":"https://github.com/arrayfire/arrayfire.git","svn_url":"https://github.com/arrayfire/arrayfire","homepage":"https://arrayfire.com","size":11708,"stargazers_count":2169,"watchers_count":2169,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":326,"mirror_url":null,"archived":false,"open_issues_count":184,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":326,"open_issues":184,"watchers":2169,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263"},"html":{"href":"https://github.com/arrayfire/arrayfire/pull/2263"},"issue":{"href":"https://api.github.com/repos/arrayfire/arrayfire/issues/2263"},"comments":{"href":"https://api.github.com/repos/arrayfire/arrayfire/issues/2263/comments"},"review_comments":{"href":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263/comments"},"review_comment":{"href":"https://api.github.com/repos/arrayfire/arrayfire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arrayfire/arrayfire/pulls/2263/commits"},"statuses":{"href":"https://api.github.com/repos/arrayfire/arrayfire/statuses/35c36c24a6d76aab82cd3633782d58afbcaac363"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mark-poscablo"}}