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

FROM-ARRAY infers the type of an array incorrectly #108

Open
colescott opened this issue May 7, 2020 · 1 comment
Open

FROM-ARRAY infers the type of an array incorrectly #108

colescott opened this issue May 7, 2020 · 1 comment
Labels

Comments

@colescott
Copy link
Member

When running
CL-USER> (magicl:from-array (make-array '(3) :initial-contents '(3d0 3d0 3d0)) '(3))
I get an error of
no compatible tensor constructor for type T

This is because FROM-ARRAY by default specializes the tensor on the ARRAY-ELEMENT-TYPE of the input array when TYPE is not specified. This should be changed to inspect the first element in the case that ARRAY-ELEMENT-TYPE is T.

@swapneils
Copy link

I have been encountering this error on the current master branch regardless of the dimensions of the array, including if it is a simple vector. from-list works fine, however.

(if relevant, I'm on a windows computer with SBCL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants