@Namespace(value="torch::nn") @NoOffset @Properties(inherit=torch.class) public class TransformerDecoderLayerImpl extends TransformerDecoderLayerImplCloneable
torch::nn::TransformerDecoderLayerOptions
class
to learn what constructor arguments are supported for this module.
Example:
TransformerDecoderLayer model(TransformerDecoderLayerOptions(512,
8).dropout(0.2));
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
TransformerDecoderLayerImpl(long d_model,
long nhead) |
TransformerDecoderLayerImpl(Module pointer)
Downcast constructor.
|
TransformerDecoderLayerImpl(Pointer p)
Pointer cast constructor.
|
TransformerDecoderLayerImpl(TransformerDecoderLayerOptions options_) |
Modifier and Type | Method and Description |
---|---|
Tensor |
forward(Tensor tgt,
Tensor memory) |
Tensor |
forward(Tensor tgt,
Tensor memory,
Tensor tgt_mask,
Tensor memory_mask,
Tensor tgt_key_padding_mask,
Tensor memory_key_padding_mask)
Pass the inputs (and mask) through the decoder layer.
|
TransformerDecoderLayerOptions |
options()
The options used to configure this module.
|
TransformerDecoderLayerImpl |
options(TransformerDecoderLayerOptions setter) |
void |
reset_parameters() |
void |
reset()
reset() must perform initialization of all members with reference
semantics, most importantly parameters, buffers and submodules. |
asModule, asModule, clone, clone
apply, apply, apply, apply, apply, apply, apply, apply, buffers, buffers, children, eval, is_serializable, is_training, load, modules, modules, name, named_buffers, named_buffers, named_children, named_modules, named_modules, named_modules, named_parameters, named_parameters, parameters, parameters, pretty_print, register_buffer, register_buffer, register_module, register_module, register_parameter, register_parameter, register_parameter, register_parameter, save, shiftLeft, to, to, to, train, unregister_module, unregister_module, zero_grad
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 TransformerDecoderLayerImpl(Pointer p)
Pointer(Pointer)
.public TransformerDecoderLayerImpl(Module pointer)
public TransformerDecoderLayerImpl(@Cast(value="int64_t") long d_model, @Cast(value="int64_t") long nhead)
public TransformerDecoderLayerImpl(@ByVal TransformerDecoderLayerOptions options_)
public void reset()
TransformerDecoderLayerImplCloneable
reset()
must perform initialization of all members with reference
semantics, most importantly parameters, buffers and submodules.reset
in class TransformerDecoderLayerImplCloneable
public void reset_parameters()
@ByVal public Tensor forward(@ByVal Tensor tgt, @Const @ByRef Tensor memory, @Const @ByRef(nullValue="torch::Tensor{}") Tensor tgt_mask, @Const @ByRef(nullValue="torch::Tensor{}") Tensor memory_mask, @Const @ByRef(nullValue="torch::Tensor{}") Tensor tgt_key_padding_mask, @Const @ByRef(nullValue="torch::Tensor{}") Tensor memory_key_padding_mask)
@ByRef public TransformerDecoderLayerOptions options()
public TransformerDecoderLayerImpl options(TransformerDecoderLayerOptions setter)
Copyright © 2024. All rights reserved.