未验证 提交 4bcb5cc4 编写于 作者: L lijialin03 提交者: GitHub

add assert of BatchSampler (#53778)

上级 06736921
......@@ -133,6 +133,11 @@ class BatchSampler(Sampler):
), "batch_size should be a positive integer, but got {}".format(
batch_size
)
assert batch_size <= len(
self.sampler
), "batch_size should not bigger than num of samples, but got {}".format(
batch_size
)
self.batch_size = batch_size
assert isinstance(
drop_last, bool
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册