{"action":"opened","issue":{"url":"https://api.github.com/repos/baidu/Paddle/issues/221","repository_url":"https://api.github.com/repos/baidu/Paddle","labels_url":"https://api.github.com/repos/baidu/Paddle/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/baidu/Paddle/issues/221/comments","events_url":"https://api.github.com/repos/baidu/Paddle/issues/221/events","html_url":"https://github.com/baidu/Paddle/issues/221","id":183627969,"number":221,"title":"questions about  CpuMatrix::mul(CpuSparseMatrix* a, MatBType* b, MatCType* c, real scaleAB, real scaleT)","user":{"login":"shenhuinuist","id":9400309,"avatar_url":"https://avatars.githubusercontent.com/u/9400309?v=3","gravatar_id":"","url":"https://api.github.com/users/shenhuinuist","html_url":"https://github.com/shenhuinuist","followers_url":"https://api.github.com/users/shenhuinuist/followers","following_url":"https://api.github.com/users/shenhuinuist/following{/other_user}","gists_url":"https://api.github.com/users/shenhuinuist/gists{/gist_id}","starred_url":"https://api.github.com/users/shenhuinuist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenhuinuist/subscriptions","organizations_url":"https://api.github.com/users/shenhuinuist/orgs","repos_url":"https://api.github.com/users/shenhuinuist/repos","events_url":"https://api.github.com/users/shenhuinuist/events{/privacy}","received_events_url":"https://api.github.com/users/shenhuinuist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-18T09:00:52Z","updated_at":"2016-10-18T09:00:52Z","closed_at":null,"body":"1、我现在想用paddle给的方法执行两个矩阵相乘，C = A*B。 A是稀疏矩阵，B是稠密矩阵。我在Matrix.cpp中找到这个函数：\r\nvoid  CpuMatrix::mul(CpuSparseMatrix* a, CpuMatrix* b, real scaleAB,  real scaleT) {\r\n  if (dynamic_cast<CacheRowCpuMatrix*>(b)) {\r\n    return mul(a, dynamic_cast<CacheRowCpuMatrix*>(b), this, scaleAB, scaleT);\r\n  } else if (dynamic_cast<SparseRowCpuMatrix*>(b)) {\r\n    return mul(a, dynamic_cast<SparseRowCpuMatrix*>(b), this, scaleAB, scaleT);\r\n  } else {\r\n    return mul(a, b, this, scaleAB, scaleT);\r\n  }\r\n我的情况应该是最后一个return，但是我不确定mul(a, b, this, scaleAB, scaleT)的实现，我只找到了这个函数：\r\nvoid CpuMatrix::mul(CpuSparseMatrix* a, MatBType* b, MatCType* c, real scaleAB, real scaleT)，此处我的理解是否正确？\r\n在void CpuMatrix::mul(CpuSparseMatrix* a, MatBType* b, MatCType* c, real scaleAB, real scaleT)这个函数里面，代码中提到了不支持A是SPARSE_CSR存储格式（CHECK_EQ(a->getFormat(), SPARSE_CSR) << \"Not supported\" ），且还不支持好几种情况：例如scaleAB=1 等等，现在针对A是SPARSE_CSR存储格式的情况，以及代码中提到的另外几种不支持的情况，paddle给出实现了吗？\r\n2、基于我之前的理解是正确的，那么在这个函数里CpuMatrix::mul(CpuSparseMatrix* a, MatBType* b, MatCType* c, real scaleAB, real scaleT)\r\n我的A设置成 是 [0, 1, 0, 2, 0;1, 0, 0, 0, 0;0, 0, 0, 2, 5];  按照SPARSE_CSC存储，col   [0, 1, 2, 2, 4, 5]; row   [1, 0, 0, 2, 2];  value [1, 1, 2, 2, 5];\r\n 函数里面，第一次的start = a->getRowStartIdx(1);  end = a->getRowStartIdx(1 + 1); 这样的话对应上述row 的值，start=1，而end = 0? 我无法理解矩阵按照SPARSE_CSC存储下，getRowStartIdx的取值，请指正，谢谢。\r\n"}}
{"actor":{"display_login":"shenhuinuist"}}