Suppose a package defines an array type SomeArray
which, like Array
, supports arbitrary dimensionality:
struct SomeArray{N} <: AbstractArray{Float32, N} end # the element type doesn't matter here, it's merely an example
When defining the broadcasting style, how to decide whether to make it subtype AbstractArrayStyle{Any}
or to make it subtype AbstractArrayStyle{N}
? What’s the difference between the two options? Are there any implications for performance or safety? Is there any significance to the choice at all?
Relevant docs: