Skip to content

Commit c774c86

Browse files
committed
Document is_column_major
1 parent db1c9a2 commit c774c86

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/stridelayout.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ stride_rank(x, i) = stride_rank(x)[i]
177177
stride_rank(::Type{R}) where {T, N, S, A <: Array{S}, R <: Base.ReinterpretArray{T, N, S, A}} = StrideRank{ntuple(identity, Val{N}())}()
178178

179179
"""
180-
is_column_major(A) -> Val{true/false}()
180+
is_column_major(A) -> Val{true/false}()
181+
182+
Returns `Val{true}` if elements of `A` are stored in column major order. Otherwise returns `Val{false}`.
181183
"""
182184
is_column_major(A) = is_column_major(stride_rank(A), contiguous_batch_size(A))
183185
is_column_major(::Nothing, ::Any) = Val{false}()
@@ -250,7 +252,7 @@ permute(t::NTuple{N}, I::NTuple{N,Int}) where {N} = ntuple(n -> t[I[n]], Val{N}(
250252
end
251253

252254
"""
253-
strides(A)
255+
strides(A) -> Tuple
254256
255257
Returns the strides of array `A`. If any strides are known at compile time,
256258
these should be returned as `Static` numbers. For example:
@@ -399,6 +401,9 @@ end
399401

400402
"""
401403
known_strides(::Type{T}[, d]) -> Tuple
404+
405+
Returns the strides of array `A` known at compile time. Any strides that are not known at
406+
compile time are represented by `nothing`.
402407
"""
403408
known_strides(x) = known_strides(typeof(x))
404409
known_strides(x, d) = known_strides(x)[to_dims(x, d)]

0 commit comments

Comments
 (0)