We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Cannot multiply a non-square sparse matrix with an ndarray.
To Reproduce
import taichi as ti ti.init(arch=ti.cpu) n_rows, n_cols = 4, 3 #n_rows, n_cols = 4, 4 # this works sparse_matrix_builder = ti.linalg.SparseMatrixBuilder(n_rows, n_cols, max_num_triplets=12) @ti.kernel def fill_sparse_matrix(sparse_matrix_builder: ti.types.sparse_matrix_builder()): for i in range(n_rows): for j in range(n_cols): sparse_matrix_builder[i, j] += i fill_sparse_matrix(sparse_matrix_builder) sparse_matrix = sparse_matrix_builder.build() #dense_vector = ti.field(dtype=ti.f32, shape=n_cols) # this works dense_vector = ti.ndarray(dtype=ti.f32, shape=n_cols) @ti.kernel def initialize_vector(): for i in range(n_cols): dense_vector[i] = i * 2.0 dense_vector = sparse_matrix@dense_vector print("\nResult:") for i in range(n_rows): print("Row {}: {}".format(i, dense_vector[i]))
Log
[Taichi] version 1.7.0, llvm 15.0.1, commit 2fd24490, win, python 3.11.5 [Taichi] Starting on arch=x64 Assertion failed: rows == this->rows() && cols == this->cols() && "DenseBase::resize() does not actually allow to resize.", file C:\Users\buildbot\actions-runner\_work\taichi\taichi\external\eigen\Eigen\src/Core/DenseBase.h, line 257
Additional comments Currently the followings are OK:
However, multiplying a non-square matrix with a ti.ndarray will produce errors.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Cannot multiply a non-square sparse matrix with an ndarray.
To Reproduce
Log
Additional comments
Currently the followings are OK:
However, multiplying a non-square matrix with a ti.ndarray will produce errors.
The text was updated successfully, but these errors were encountered: