-
Notifications
You must be signed in to change notification settings - Fork 170
Implement numpy.size() and numpy.shape() #1457
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
Labels
numpy
Bugs and feature requests regarding NumPy support
Comments
Also |
Next on my TODO list (after lfortran/lfortran#1210). |
numpy.size() has already been completed in this #1777 .
I can try to add this. But for shape we would need another intrinsic like |
Use the integer(8) :: x(2, 2)
print*, shape(x)
end It gives: [(Print
[(IntrinsicArrayFunction
Shape
[(ArrayPhysicalCast
(Var 2 x)
FixedSizeArray
DescriptorArray
(Array
(Integer 8)
[((IntegerConstant 1 (Integer 4))
(IntegerConstant 2 (Integer 4)))
((IntegerConstant 1 (Integer 4))
(IntegerConstant 2 (Integer 4)))]
DescriptorArray
)
()
)]
0
(Array
(Integer 4)
[((IntegerConstant 1 (Integer 4))
(IntegerConstant 2 (Integer 4)))]
FixedSizeArray
)
(ArrayConstant
[(IntegerConstant 2 (Integer 4))
(IntegerConstant 2 (Integer 4))]
(Array
(Integer 4)
[((IntegerConstant 1 (Integer 4))
(IntegerConstant 2 (Integer 4)))]
FixedSizeArray
)
ColMajor
)
)]
()
()
)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And use the ArraySize intrinsic.
The text was updated successfully, but these errors were encountered: