-
Notifications
You must be signed in to change notification settings - Fork 65
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
support alibi embedding #24
Conversation
src/layers/alibi_embedding.cpp
Outdated
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.
Look like the codeis not formatted, pls format it.
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.
Code has been formatted
Please use Camel case to rename variables and functions. |
src/layers/alibi_embedding.h
Outdated
void alibiGetBias(const int headIdx, const int seqLen, float *bias_matrx); | ||
|
||
private: | ||
static bool initialized; |
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.
What's the meaning of this bool var? Nothing will be shared between objects.
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.
This variable is used to determine whether the distance matrix has been initialized or not. And In this pr, 1. If alibiGetBias function is called directly without the initialization judgment, an error will occur. 2. The distance matrix can be reused w/ single instance.
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.
All the functions are not static, so they can't be called without instantiating a class. And you will initialize it in the constructor. Will you offer a constructor method without initialization or a static method?
No description provided.