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

The Resize function doesn't change stride_ if resize_type == kSetZero and rows == MatrixBase<Real>::num_rows_ && cols == MatrixBase<Real>::num_cols_. #4904

Open
moshimo2019 opened this issue Jan 27, 2024 · 0 comments

Comments

@moshimo2019
Copy link

          The `Resize` function doesn't change `stride_` if resize_type == kSetZero and `rows == MatrixBase<Real>::num_rows_ && cols == MatrixBase<Real>::num_cols_`.

The following code will crash if the column of the matrix to be loaded isn't multiple of 4

kaldi::Matrix<kaldi::BaseFloat> sli(0, 0, kaldi::kSetZero, kaldi::kStrideEqualNumCols);
std::ifstream ifs("matrix.txt");
sli.Read(ifs, false);
sli.Resize(sli.NumRows(), sli.NumCols(), kaldi::kSetZero, kaldi::kStrideEqualNumCols);
assert(sli.NumCols() == sli.Stride());

Originally posted by @moshimo2019 in #2025 (comment)

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

No branches or pull requests

1 participant