@Namespace(value="torch::nn") @NoOffset @Properties(inherit=torch.class) public class TransformerOptions extends Pointer
Transformer
module
Example:
TransformerOptions options;
TransformerOptions options(16, 4);
auto options = TransformerOptions().d_model(4).nhead(2).dropout(0.0);
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
TransformerOptions() |
TransformerOptions(long size)
Native array allocator.
|
TransformerOptions(long d_model,
long nhead) |
TransformerOptions(long d_model,
long nhead,
long num_encoder_layers,
long num_decoder_layers) |
TransformerOptions(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
TransformerActivation |
activation() |
AnyModule |
custom_decoder() |
AnyModule |
custom_encoder() |
LongPointer |
d_model() |
LongPointer |
dim_feedforward() |
DoublePointer |
dropout() |
TransformerOptions |
getPointer(long i) |
LongPointer |
nhead() |
LongPointer |
num_decoder_layers() |
LongPointer |
num_encoder_layers() |
TransformerOptions |
position(long position) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public TransformerOptions(Pointer p)
Pointer(Pointer)
.public TransformerOptions(long size)
Pointer.position(long)
.public TransformerOptions()
public TransformerOptions(@Cast(value="int64_t") long d_model, @Cast(value="int64_t") long nhead)
public TransformerOptions position(long position)
public TransformerOptions getPointer(long i)
getPointer
in class Pointer
@Cast(value="int64_t*") @ByRef @NoException(value=true) public LongPointer d_model()
@Cast(value="int64_t*") @ByRef @NoException(value=true) public LongPointer nhead()
@Cast(value="int64_t*") @ByRef @NoException(value=true) public LongPointer num_encoder_layers()
@Cast(value="int64_t*") @ByRef @NoException(value=true) public LongPointer num_decoder_layers()
@Cast(value="int64_t*") @ByRef @NoException(value=true) public LongPointer dim_feedforward()
@ByRef @NoException(value=true) public DoublePointer dropout()
@ByRef @NoException(value=true) public TransformerActivation activation()
@ByRef @NoException(value=true) public AnyModule custom_encoder()
@ByRef @NoException(value=true) public AnyModule custom_decoder()
Copyright © 2024. All rights reserved.