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

Initial elements concern in Tensor/Vector/Matrix storage constructors #148

Open
ghost opened this issue Oct 27, 2021 · 0 comments
Open

Initial elements concern in Tensor/Vector/Matrix storage constructors #148

ghost opened this issue Oct 27, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 27, 2021

In storage constructors of tensor, vector, and matrix, make-array has been used to initialise the actual storage.

Before PR #143, make-array doesn't specify zero as the :initial-element argument. It causes inconsistencies among different Lisp implementations, as unspecified :initial-element argument is undefined behaviour in the standard.

One example is from-diag. It forgot to specify :initial-elements in both of the occurrences of make-tensor. While this works in SBCL (where make-array initialises all zeros), it won't work in other implementations e.g. allegro.

Therefore, PR #143 tried to fix this issue by explicitly specifying zeros as :initial-element argument in all storage constructors.

As Erik suggested:

perhaps it is something we will try to fix in a more systematic fashion.

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

0 participants