@Name(value="torch::data::datasets::StatefulDataset<torch::data::datasets::ChunkDataset<JavaCPP_torch_0003a_0003adata_0003a_0003adatasets_0003a_0003aChunkDataReader_0003ctorch_0003a_0003adata_0003a_0003aExample_0003ctorch_0003a_0003aTensor_0002ctorch_0003a_0003aTensor_0003e_0002cstd_0003a_0003avector_0003ctorch_0003a_0003adata_0003a_0003aExample_0003ctorch_0003a_0003aTensor_0002ctorch_0003a_0003aTensor_0003e_00020_0003e_00020_0003e,torch::data::samplers::RandomSampler,torch::data::samplers::RandomSampler>,JavaCPP_torch_0003a_0003adata_0003a_0003adatasets_0003a_0003aChunkDataReader_0003ctorch_0003a_0003adata_0003a_0003aExample_0003ctorch_0003a_0003aTensor_0002ctorch_0003a_0003aTensor_0003e_0002cstd_0003a_0003avector_0003ctorch_0003a_0003adata_0003a_0003aExample_0003ctorch_0003a_0003aTensor_0002ctorch_0003a_0003aTensor_0003e_00020_0003e_00020_0003e::BatchType,size_t>") @Properties(inherit=torch.class) public class ChunkStatefulDataset extends ChunkBatchDataset
reset()
at the beginning of each epoch. Subclasses can override
the reset()
method to configure this behavior. Further, the return type of
a stateful dataset's get_batch()
method is always an optional
. When the
stateful dataset wants to indicate to the dataloader that its epoch has
ended, it should return an empty optional. The dataloader knows to modify
its implementation based on whether the dataset is stateless or stateful.
Note that when subclassing a from StatefulDataset<Self, T>
, the return
type of get_batch()
, which the subclass must override, will be
optional<T>
(i.e. the type specified in the StatefulDataset
specialization is automatically boxed into an optional
for the dataset's
BatchType
).Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
is_stateful
Constructor and Description |
---|
ChunkStatefulDataset(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
load(InputArchive archive)
Deserializes the statefulDataset's state from the
archive . |
void |
reset()
Resets internal state of the dataset.
|
void |
save(OutputArchive archive)
Saves the statefulDataset's state to OutputArchive.
|
get_batch, is_stateful, size
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 ChunkStatefulDataset(Pointer p)
Pointer(Pointer)
.public void reset()
public void save(@ByRef OutputArchive archive)
public void load(@ByRef InputArchive archive)
archive
.Copyright © 2024. All rights reserved.