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
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ julia> ArrayInterface.size(a)
44
44
(static(1), 3)
45
45
46
46
julia> ArrayInterface.known_size(typeof(a))
47
-
(1, missing)
47
+
(1, nothing)
48
48
49
49
```
50
50
@@ -62,8 +62,8 @@ Methods should avoid forcing conversion to static sizes when dynamic sizes could
62
62
Fore example, `fxn(x) = _fxn(Static.static(ArrayInterface.size(x)), x)` would result in dynamic dispatch if `x` is an instance of `Matrix`.
63
63
Additionally, `ArrayInterface.size` should only be used outside of generated functions to avoid possible world age issues.
64
64
65
-
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 `missing`.
66
-
For example, the previous example had a known size of `(1, missing)`.
65
+
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`.
66
+
For example, the previous example had a known size of `(1, nothing)`.
67
67
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.
68
68
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)`.
69
69
Generic support for `ArrayInterface.known_size` relies on calling `known_length` for each type returned from `axes_types`.
@@ -108,13 +108,13 @@ ArrayInterface.dimnames(::StaticDimnames{dnames}) where {dnames} = static(dnames
108
108
struct DynamicDimnames{N}
109
109
dimnames::NTuple{N,Symbol}
110
110
end
111
-
ArrayInterface.known_dimnames(::Type{DynamicDimnames{N}}) where {N} =ntuple(_->missing, Val(N))
111
+
ArrayInterface.known_dimnames(::Type{DynamicDimnames{N}}) where {N} =ntuple(_->nothing, Val(N))
0 commit comments