-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matrix API refactor #934
Matrix API refactor #934
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后面可以考虑一下如何把这几个写成Function的形式。Matrix::mul可以先不考虑,mul里面包含好几个分支。
virtual void contextProjectionForward(MatrixPtr input, | ||
MatrixPtr weight, | ||
virtual void contextProjectionForward(Matrix& input, | ||
Matrix* weight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matrix* -> Matrix&
后面的也一样,都用Matrix&就可以了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main motivation to use Matrix * here is that we need to compare "if (weight)" in Matrix.cpp. It might be convenient to use raw pointer here instead of reference. What do you suggest?
…rixPtr) to reference or raw matrix (Matrix & or Matrix *) contextProjectionForward contextProjectionBackward contextProjectionBackwardData contextProjectionBackwardWeight classificationError The mul functions would be updated later.
e00b726
to
4fbf949
Compare
Just add the refractor for mul |
When passing parameters, we use object reference or raw pointer instead of shared_ptr. (issue: #703)
The following API has been updated:
contextProjectionForward
contextProjectionBackward
contextProjectionBackwardData
contextProjectionBackwardWeight
classificationError
mul