{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/319090154","pull_request_review_id":281484101,"id":319090154,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxOTA5MDE1NA==","diff_hunk":"@@ -69,22 +47,58 @@ inline mkldnn::memory::format GetWeightsFormat(mkldnn::memory::format format,\n   }\n }\n \n+inline void ComputeOutputShiftScale(\n+    std::vector<float>& output_shift_scale, int count,  // NOLINT\n+    const int groups, const std::vector<int>& weights_tz, float scale_out_data,\n+    float scale_in_eltwise_data, float scale_in_data,\n+    const std::vector<float>& scale_weights_data) {\n+#pragma omp parallel for\n+  for (int i = 0; i < count; i++) {\n+    if (scale_weights_data[i] == 0.0) {\n+      output_shift_scale[i] = scale_out_data;\n+    } else {\n+      output_shift_scale[i] =\n+          static_cast<float>(static_cast<double>(scale_out_data) /\n+                             (static_cast<double>(scale_in_data) *\n+                              static_cast<double>(scale_weights_data[i])));\n+    }\n+  }\n+}\n+\n+inline void ComputeBiasScale(std::vector<float>& scale_bias_data,  // NOLINT\n+                             int count, int g,\n+                             const std::vector<int>& weights_tz,\n+                             float scale_in_data,\n+                             const std::vector<float>& scale_weights_data) {\n+#pragma omp parallel for if (count > 1)\n+  for (int i = 0; i < count; i++) {\n+    scale_bias_data[i] = scale_in_data * scale_weights_data[i];\n+  }\n+}\n+\n static mkldnn::memory::data_type GetDstType(bool is_int8,\n                                             bool force_fp32_output,\n                                             std::string fuse_activation,\n                                             bool fuse_residual_conn,\n                                             const Tensor* residual_param) {\n   auto dst_dt = mkldnn::memory::data_type::f32;  // uint8_t, int8_t, float\n   if (is_int8) {","path":"paddle/fluid/operators/mkldnn/conv_mkldnn_op.cc","position":null,"original_position":79,"commit_id":"affc4afa41bd2262a8dc67c0aba56e004c3dd7de","original_commit_id":"80f53d4e3bc58c214111b9257cf2463613e784fb","user":{"login":"lidanqing-intel","id":47151829,"node_id":"MDQ6VXNlcjQ3MTUxODI5","avatar_url":"https://avatars2.githubusercontent.com/u/47151829?v=4","gravatar_id":"","url":"https://api.github.com/users/lidanqing-intel","html_url":"https://github.com/lidanqing-intel","followers_url":"https://api.github.com/users/lidanqing-intel/followers","following_url":"https://api.github.com/users/lidanqing-intel/following{/other_user}","gists_url":"https://api.github.com/users/lidanqing-intel/gists{/gist_id}","starred_url":"https://api.github.com/users/lidanqing-intel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidanqing-intel/subscriptions","organizations_url":"https://api.github.com/users/lidanqing-intel/orgs","repos_url":"https://api.github.com/users/lidanqing-intel/repos","events_url":"https://api.github.com/users/lidanqing-intel/events{/privacy}","received_events_url":"https://api.github.com/users/lidanqing-intel/received_events","type":"User","site_admin":false},"body":"Yes, that would be better. I changed.","created_at":"2019-08-29T14:06:54Z","updated_at":"2019-08-29T14:06:54Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/19543#discussion_r319090154","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/319090154"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/19543#discussion_r319090154"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543"}},"in_reply_to_id":319074691},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543","id":312317271,"node_id":"MDExOlB1bGxSZXF1ZXN0MzEyMzE3Mjcx","html_url":"https://github.com/PaddlePaddle/Paddle/pull/19543","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/19543.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/19543.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19543","number":19543,"state":"open","locked":false,"title":"Modify conv INT8 scales functions, getWeightsTz and getDstType","user":{"login":"lidanqing-intel","id":47151829,"node_id":"MDQ6VXNlcjQ3MTUxODI5","avatar_url":"https://avatars2.githubusercontent.com/u/47151829?v=4","gravatar_id":"","url":"https://api.github.com/users/lidanqing-intel","html_url":"https://github.com/lidanqing-intel","followers_url":"https://api.github.com/users/lidanqing-intel/followers","following_url":"https://api.github.com/users/lidanqing-intel/following{/other_user}","gists_url":"https://api.github.com/users/lidanqing-intel/gists{/gist_id}","starred_url":"https://api.github.com/users/lidanqing-intel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidanqing-intel/subscriptions","organizations_url":"https://api.github.com/users/lidanqing-intel/orgs","repos_url":"https://api.github.com/users/lidanqing-intel/repos","events_url":"https://api.github.com/users/lidanqing-intel/events{/privacy}","received_events_url":"https://api.github.com/users/lidanqing-intel/received_events","type":"User","site_admin":false},"body":"@wojtuss Please take a look at function GetDstType, do you think this way would be better?","created_at":"2019-08-29T13:25:03Z","updated_at":"2019-08-29T14:06:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b45d041ccfebc5ad327adc41f99209a4fdc34453","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19543/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/affc4afa41bd2262a8dc67c0aba56e004c3dd7de","head":{"label":"lidanqing-intel:develop-conv-step-by-step-reference","ref":"develop-conv-step-by-step-reference","sha":"affc4afa41bd2262a8dc67c0aba56e004c3dd7de","user":{"login":"lidanqing-intel","id":47151829,"node_id":"MDQ6VXNlcjQ3MTUxODI5","avatar_url":"https://avatars2.githubusercontent.com/u/47151829?v=4","gravatar_id":"","url":"https://api.github.com/users/lidanqing-intel","html_url":"https://github.com/lidanqing-intel","followers_url":"https://api.github.com/users/lidanqing-intel/followers","following_url":"https://api.github.com/users/lidanqing-intel/following{/other_user}","gists_url":"https://api.github.com/users/lidanqing-intel/gists{/gist_id}","starred_url":"https://api.github.com/users/lidanqing-intel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidanqing-intel/subscriptions","organizations_url":"https://api.github.com/users/lidanqing-intel/orgs","repos_url":"https://api.github.com/users/lidanqing-intel/repos","events_url":"https://api.github.com/users/lidanqing-intel/events{/privacy}","received_events_url":"https://api.github.com/users/lidanqing-intel/received_events","type":"User","site_admin":false},"repo":{"id":168185239,"node_id":"MDEwOlJlcG9zaXRvcnkxNjgxODUyMzk=","name":"Paddle","full_name":"lidanqing-intel/Paddle","private":false,"owner":{"login":"lidanqing-intel","id":47151829,"node_id":"MDQ6VXNlcjQ3MTUxODI5","avatar_url":"https://avatars2.githubusercontent.com/u/47151829?v=4","gravatar_id":"","url":"https://api.github.com/users/lidanqing-intel","html_url":"https://github.com/lidanqing-intel","followers_url":"https://api.github.com/users/lidanqing-intel/followers","following_url":"https://api.github.com/users/lidanqing-intel/following{/other_user}","gists_url":"https://api.github.com/users/lidanqing-intel/gists{/gist_id}","starred_url":"https://api.github.com/users/lidanqing-intel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidanqing-intel/subscriptions","organizations_url":"https://api.github.com/users/lidanqing-intel/orgs","repos_url":"https://api.github.com/users/lidanqing-intel/repos","events_url":"https://api.github.com/users/lidanqing-intel/events{/privacy}","received_events_url":"https://api.github.com/users/lidanqing-intel/received_events","type":"User","site_admin":false},"html_url":"https://github.com/lidanqing-intel/Paddle","description":"PArallel Distributed Deep LEarning （PaddlePaddle核心框架，高性能单机、分布式训练和跨平台部署）","fork":true,"url":"https://api.github.com/repos/lidanqing-intel/Paddle","forks_url":"https://api.github.com/repos/lidanqing-intel/Paddle/forks","keys_url":"https://api.github.com/repos/lidanqing-intel/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lidanqing-intel/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lidanqing-intel/Paddle/teams","hooks_url":"https://api.github.com/repos/lidanqing-intel/Paddle/hooks","issue_events_url":"https://api.github.com/repos/lidanqing-intel/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/lidanqing-intel/Paddle/events","assignees_url":"https://api.github.com/repos/lidanqing-intel/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/lidanqing-intel/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/lidanqing-intel/Paddle/tags","blobs_url":"https://api.github.com/repos/lidanqing-intel/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lidanqing-intel/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lidanqing-intel/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/lidanqing-intel/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lidanqing-intel/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/lidanqing-intel/Paddle/languages","stargazers_url":"https://api.github.com/repos/lidanqing-intel/Paddle/stargazers","contributors_url":"https://api.github.com/repos/lidanqing-intel/Paddle/contributors","subscribers_url":"https://api.github.com/repos/lidanqing-intel/Paddle/subscribers","subscription_url":"https://api.github.com/repos/lidanqing-intel/Paddle/subscription","commits_url":"https://api.github.com/repos/lidanqing-intel/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/lidanqing-intel/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/lidanqing-intel/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/lidanqing-intel/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/lidanqing-intel/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/lidanqing-intel/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lidanqing-intel/Paddle/merges","archive_url":"https://api.github.com/repos/lidanqing-intel/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lidanqing-intel/Paddle/downloads","issues_url":"https://api.github.com/repos/lidanqing-intel/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/lidanqing-intel/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/lidanqing-intel/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/lidanqing-intel/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lidanqing-intel/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/lidanqing-intel/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/lidanqing-intel/Paddle/deployments","created_at":"2019-01-29T16:13:35Z","updated_at":"2019-03-05T18:02:03Z","pushed_at":"2019-08-29T14:05:17Z","git_url":"git://github.com/lidanqing-intel/Paddle.git","ssh_url":"git@github.com:lidanqing-intel/Paddle.git","clone_url":"https://github.com/lidanqing-intel/Paddle.git","svn_url":"https://github.com/lidanqing-intel/Paddle","homepage":"http://www.paddlepaddle.org/","size":163873,"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,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"ba368bf69621bdcf2c42fbb8a0ae25272f4df648","user":{"login":"PaddlePaddle","id":23534030,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0MDMw","avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":65711522,"node_id":"MDEwOlJlcG9zaXRvcnk2NTcxMTUyMg==","name":"Paddle","full_name":"PaddlePaddle/Paddle","private":false,"owner":{"login":"PaddlePaddle","id":23534030,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0MDMw","avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/PaddlePaddle/Paddle","description":"PArallel Distributed Deep LEarning （『飞桨』核心框架，高性能单机、分布式训练和跨平台部署）","fork":false,"url":"https://api.github.com/repos/PaddlePaddle/Paddle","forks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/Paddle/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/Paddle/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/Paddle/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/Paddle/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/deployments","created_at":"2016-08-15T06:59:08Z","updated_at":"2019-08-29T10:25:03Z","pushed_at":"2019-08-29T14:05:20Z","git_url":"git://github.com/PaddlePaddle/Paddle.git","ssh_url":"git@github.com:PaddlePaddle/Paddle.git","clone_url":"https://github.com/PaddlePaddle/Paddle.git","svn_url":"https://github.com/PaddlePaddle/Paddle","homepage":"http://www.paddlepaddle.org/","size":166492,"stargazers_count":9786,"watchers_count":9786,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2616,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1531,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2616,"open_issues":1531,"watchers":9786,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/19543"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19543"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/19543/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/19543/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/affc4afa41bd2262a8dc67c0aba56e004c3dd7de"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lidanqing-intel"}}