@Namespace(value="torch::nn") @NoOffset @Properties(inherit=torch.class) public class LinearImpl extends LinearImplCloneable
torch::nn::LinearOptions
class to learn what
constructor arguments are supported for this module.
Example:
Linear model(LinearOptions(5, 2).bias(false));
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
LinearImpl(LinearOptions options_) |
LinearImpl(long in_features,
long out_features) |
LinearImpl(Module pointer)
Downcast constructor.
|
LinearImpl(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Tensor |
bias()
The learned bias.
|
LinearImpl |
bias(Tensor setter) |
Tensor |
forward(Tensor input)
Transforms the
input tensor by multiplying with the weight and
optionally adding the bias , if with_bias is true in the options. |
LinearOptions |
options()
The options used to configure this module.
|
LinearImpl |
options(LinearOptions setter) |
void |
pretty_print(Pointer stream)
Pretty prints the
Linear module into the given stream . |
void |
reset_parameters() |
void |
reset()
reset() must perform initialization of all members with reference
semantics, most importantly parameters, buffers and submodules. |
Tensor |
weight()
The learned weight.
|
LinearImpl |
weight(Tensor setter) |
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, 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 LinearImpl(Pointer p)
Pointer(Pointer)
.public LinearImpl(Module pointer)
public LinearImpl(@Cast(value="int64_t") long in_features, @Cast(value="int64_t") long out_features)
public LinearImpl(@Const @ByRef LinearOptions options_)
public void reset()
LinearImplCloneable
reset()
must perform initialization of all members with reference
semantics, most importantly parameters, buffers and submodules.reset
in class LinearImplCloneable
public void reset_parameters()
public void pretty_print(@Cast(value="std::ostream*") @ByRef Pointer stream)
Linear
module into the given stream
.pretty_print
in class Module
@ByVal public Tensor forward(@Const @ByRef Tensor input)
input
tensor by multiplying with the weight
and
optionally adding the bias
, if with_bias
is true in the options.@ByRef public LinearOptions options()
public LinearImpl options(LinearOptions setter)
public LinearImpl weight(Tensor setter)
@ByRef public Tensor bias()
bias
is false in the options
, this tensor is
undefined.public LinearImpl bias(Tensor setter)
Copyright © 2024. All rights reserved.