@Name(value="torch::data::samplers::Sampler<std::vector<size_t> >") @Properties(inherit=torch.class) public class Sampler extends Pointer
Sampler
is an object that yields an index with which to access a
dataset.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
Sampler(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
load(InputArchive archive)
Deserializes the
Sampler from the archive . |
SizeTVectorOptional |
next(long batch_size)
Returns the next index if possible, or an empty optional if the
sampler is exhausted for this epoch.
|
void |
reset(SizeTOptional new_size)
Resets the
Sampler 's internal state. |
void |
save(OutputArchive archive)
Serializes the
Sampler 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 Sampler(Pointer p)
Pointer(Pointer)
.public void reset(@ByVal SizeTOptional new_size)
Sampler
's internal state.
Typically called before a new epoch.
Optionally, accepts a new size when reseting the sampler.@ByVal public SizeTVectorOptional next(@Cast(value="size_t") long batch_size)
public void save(@ByRef OutputArchive archive)
Sampler
to the archive
.public void load(@ByRef InputArchive archive)
Sampler
from the archive
.Copyright © 2024. All rights reserved.