@Namespace(value="torch::nn") @NoOffset @Properties(inherit=torch.class) public class TransformerEncoderLayerImpl extends TransformerEncoderLayerImplCloneable
torch::nn::TransformerEncoderLayer
class to
learn what constructor arguments are supported for this encoder layer model
Example:
TransformerEncoderLayer encoderLayer(TransformerEncoderLayerOptions(512,
8).dropout(0.1));
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
TransformerEncoderLayerImpl(long d_model,
long nhead) |
TransformerEncoderLayerImpl(Module pointer)
Downcast constructor.
|
TransformerEncoderLayerImpl(Pointer p)
Pointer cast constructor.
|
TransformerEncoderLayerImpl(TransformerEncoderLayerOptions options_) |
Modifier and Type | Method and Description |
---|---|
Tensor |
forward(Tensor src) |
Tensor |
forward(Tensor src,
Tensor src_mask,
Tensor src_key_padding_mask) |
TransformerEncoderLayerOptions |
options()
options with which this
TransformerEncoderLayer was constructed |
TransformerEncoderLayerImpl |
options(TransformerEncoderLayerOptions 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 TransformerEncoderLayerImpl(Pointer p)
Pointer(Pointer)
.public TransformerEncoderLayerImpl(Module pointer)
public TransformerEncoderLayerImpl(@Cast(value="int64_t") long d_model, @Cast(value="int64_t") long nhead)
public TransformerEncoderLayerImpl(@ByVal TransformerEncoderLayerOptions options_)
@ByVal public Tensor forward(@Const @ByRef Tensor src, @Const @ByRef(nullValue="torch::Tensor{}") Tensor src_mask, @Const @ByRef(nullValue="torch::Tensor{}") Tensor src_key_padding_mask)
public void reset()
TransformerEncoderLayerImplCloneable
reset()
must perform initialization of all members with reference
semantics, most importantly parameters, buffers and submodules.reset
in class TransformerEncoderLayerImplCloneable
public void reset_parameters()
@ByRef public TransformerEncoderLayerOptions options()
TransformerEncoderLayer
was constructedpublic TransformerEncoderLayerImpl options(TransformerEncoderLayerOptions setter)
Copyright © 2024. All rights reserved.