What method did Julia use?

I defined the following variable

julia> X = (1:10) * ones(1,10)

which defines a matrix with each row equal to the same number, and numbers in the column increasing from 1 to 10 by 1. I want to know which method Julia used for the function *. How can I ask Julia about this?

+4
source share
1 answer

@which is what you are looking for:

@which (1:10) * ones(1, 10)
# *(A::AbstractArray{T,1}, B::AbstractArray{T,2}) at linalg/matmul.jl:89

in Jupyter, it will also refer to the corresponding line of code where the method is defined in Julia GitHub.

+6
source

Source: https://habr.com/ru/post/1626805/


All Articles