-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]broadcastApplying a function over a collectionApplying a function over a collectioniterationInvolves iteration or the iteration protocolInvolves iteration or the iteration protocol
Description
The method axes(x) is documented under the broadcasting interface.
Note
It would be nice if the documentation was better. It does not specify when axes is used and it is not definitely specified what the argument type is. (i.e. that it should be <: Broadcasted)
However the method is not used for determining the broadcasting axes. Instead Broadcast.combine_axes is used.
Lines 312 to 314 in 1269be6
| if bc.axes isa Nothing # Not done via dispatch to make it easier to extend instantiate(::Broadcasted{Style}) | |
| axes = combine_axes(bc.args...) | |
| else |
What is the purpose of axes? (This method
Lines 238 to 244 in 1269be6
| @inline Base.axes(bc::Broadcasted) = _axes(bc, bc.axes) | |
| _axes(::Broadcasted, axes::Tuple) = axes | |
| @inline _axes(bc::Broadcasted, ::Nothing) = combine_axes(bc.args...) | |
| _axes(bc::Broadcasted{<:AbstractArrayStyle{0}}, ::Nothing) = () | |
| @inline Base.axes(bc::Broadcasted{<:Any, <:NTuple{N}}, d::Integer) where N = | |
| d <= N ? axes(bc)[d] : OneTo(1) |
Is it used anywhere in the broadcasting pipeline? Shouldn't the combine_axes be axes for the user to be able to specify it?
Anyway, it should be better documented in either case...
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]broadcastApplying a function over a collectionApplying a function over a collectioniterationInvolves iteration or the iteration protocolInvolves iteration or the iteration protocol