@Namespace(value="torch::data::samplers") @NoOffset @Properties(inherit=torch.class) public class SequentialSampler extends Sampler
Sampler
that returns indices sequentially.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
SequentialSampler(long size)
Creates a
SequentialSampler that will return indices in the range
0...size - 1 . |
SequentialSampler(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
index()
Returns the current index of the
SequentialSampler . |
void |
load(InputArchive archive)
Deserializes the
SequentialSampler from the archive . |
SizeTVectorOptional |
next(long batch_size)
Returns the next batch of indices.
|
void |
reset() |
void |
reset(SizeTOptional new_size)
Resets the
SequentialSampler to zero. |
void |
save(OutputArchive archive)
Serializes the
SequentialSampler to the archive . |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public SequentialSampler(Pointer p)
Pointer(Pointer)
.public void reset(@ByVal(nullValue="c10::optional<size_t>(c10::nullopt)") SizeTOptional new_size)
SequentialSampler
to zero.public void reset()
@ByVal public SizeTVectorOptional next(@Cast(value="size_t") long batch_size)
public void save(@ByRef OutputArchive archive)
SequentialSampler
to the archive
.public void load(@ByRef InputArchive archive)
SequentialSampler
from the archive
.@Cast(value="size_t") @NoException(value=true) public long index()
SequentialSampler
.Copyright © 2024. All rights reserved.