Skip to content

Commit

Permalink
batchsize() documentation enhance (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroBlackstone committed Dec 30, 2023
1 parent 09c87f7 commit dd03b30
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/batchview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,19 @@ _batchviewelemtype(data, ::Val{true}) =
Core.Compiler.return_type(batch, Tuple{_batchviewelemtype(data, Val(false))})

"""
batchsize(data) -> Int
batchsize(data::BatchView) -> Int
Return the fixed size of each batch in `data`.
# Examples
```julia
using MLUtils
X, Y = MLUtils.load_iris()
A = BatchView(X, batchsize=30)
@assert batchsize(A) == 30
```
"""
batchsize(A::BatchView) = A.batchsize

Expand Down

0 comments on commit dd03b30

Please sign in to comment.