Skip to content

Commit dd03b30

Browse files
batchsize() documentation enhance (#163)
1 parent 09c87f7 commit dd03b30

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: src/batchview.jl

+11-1
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,19 @@ _batchviewelemtype(data, ::Val{true}) =
112112
Core.Compiler.return_type(batch, Tuple{_batchviewelemtype(data, Val(false))})
113113

114114
"""
115-
batchsize(data) -> Int
115+
batchsize(data::BatchView) -> Int
116116
117117
Return the fixed size of each batch in `data`.
118+
119+
# Examples
120+
121+
```julia
122+
using MLUtils
123+
X, Y = MLUtils.load_iris()
124+
125+
A = BatchView(X, batchsize=30)
126+
@assert batchsize(A) == 30
127+
```
118128
"""
119129
batchsize(A::BatchView) = A.batchsize
120130

0 commit comments

Comments
 (0)