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

Forbid inefficient TensorDescriptor initialization #3393

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

CAHEK7
Copy link
Contributor

@CAHEK7 CAHEK7 commented Nov 17, 2024

Initializing TensorDescriptor from std::vector<int> is very inefficient due to extra checks and multiple intermediate vector, since internally std::vector<size_t> is used.

Changed all the initializations to the native size_t, removed constructors with std::vector<int> and added workarounds for a legacy descriptors initializations with int's.

It increased performance for the current RNN implementation for a few percents.

Copy link
Collaborator

@averinevg averinevg left a comment

Choose a reason for hiding this comment

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

LGTM, although there are a couple of minor comments.

src/tensor.cpp Show resolved Hide resolved
src/tensor.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants