Skip to content
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

Merged
merged 8 commits into from
Nov 10, 2023
Merged

support alibi embedding #24

merged 8 commits into from
Nov 10, 2023

Conversation

aurora327
Copy link
Contributor

No description provided.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code has been formatted

@Duyi-Wang
Copy link
Contributor

Please use Camel case to rename variables and functions.

void alibiGetBias(const int headIdx, const int seqLen, float *bias_matrx);

private:
static bool initialized;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

@Duyi-Wang Duyi-Wang merged commit bcf9a3a into intel:main Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants