Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug] Fix vector/matrix dtype created in the python scope (taichi-dev…
…#7948) Issue: # ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 48d61fe</samp> Preserve the dtype of matrices and vectors in Python scope and add a unit test for it. This change modifies the `np.array` constructor calls in `python/taichi/lang/matrix.py` and adds a new test function `test_matrix_dtype` in `tests/python/test_matrix.py`. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 48d61fe</samp> * Preserve the dtype of matrices and vectors when instantiated in Python scope ([link](https://github.com/taichi-dev/taichi/pull/7948/files?diff=unified&w=0#diff-5913c0a6b6a5e279414150955f30b96ea6b9676a1f5b1931ca4bcb39f19c81e9L1485-R1486), [link](https://github.com/taichi-dev/taichi/pull/7948/files?diff=unified&w=0#diff-5913c0a6b6a5e279414150955f30b96ea6b9676a1f5b1931ca4bcb39f19c81e9L1572-R1574)) * Add a unit test for the dtype preservation of matrices and vectors ([link](https://github.com/taichi-dev/taichi/pull/7948/files?diff=unified&w=0#diff-28226020cc3cc2e223eb43801fa78360d006c26d7140c3b37719faf9e9df34f7R1306-R1314))
- Loading branch information