From dd03b30d11c000a8e9ec6366372f60519991d7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nero=20Blackstone=E2=80=8B?= Date: Sun, 31 Dec 2023 00:01:04 +0800 Subject: [PATCH] batchsize() documentation enhance (#163) --- src/batchview.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/batchview.jl b/src/batchview.jl index d5a1467..7778dae 100644 --- a/src/batchview.jl +++ b/src/batchview.jl @@ -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