You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ Additionally, `ArrayInterface.size` should only be used outside of generated fun
45
45
Generally, `ArrayInterface.size` uses the return of `known_size` to form a static value for those dimensions with known length and only queries dimensions corresponding to `nothing`.
46
46
For example, the previous example had a known size of `(1, nothing)`.
47
47
Therefore, `ArrayInterface.size` would have compile time information about the first dimension returned as `static(1)` and would only look up the size of the second dimension at run time.
48
+
This means the above example `ArrayInterface.size(a)` would lower to code similar to this at compile time: `Static.StaticInt(1), Base.arraysize(x, 1)`.
48
49
Generic support for `ArrayInterface.known_size` relies on calling `known_length` for each type returned from `axes_types`.
49
50
Therefore, the recommended approach for supporting static sizing in newly defined array types is defining a new `axes_types` method.
0 commit comments