@Namespace(value="torch::nn") @Properties(inherit=torch.class) public class ParameterDictImpl extends ParameterDictImplCloneable
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
ParameterDictImpl() |
ParameterDictImpl(Module pointer)
Downcast constructor.
|
ParameterDictImpl(Pointer p)
Pointer cast constructor.
|
ParameterDictImpl(StringTensorDict params) |
Modifier and Type | Method and Description |
---|---|
StringTensorDictItemVector.Iterator |
begin()
Return an iterator to the start of ParameterDict
|
void |
clear()
Remove all parameters in the ParameterDict
|
boolean |
contains(BytePointer key)
Check if the centain parameter with the key in the ParameterDict
|
boolean |
contains(String key) |
boolean |
empty()
Return true if the ParameterDict is empty, otherwise return false
|
StringTensorDictItemVector.Iterator |
end()
Return an iterator to the end of ParameterDict
|
Tensor |
get(BytePointer key)
Returns the value associated with the given
key . |
Tensor |
get(String key) |
Tensor |
insert(BytePointer key,
Tensor param)
Insert the parameter along with the key into ParameterDict
The parameter is set to be require grad by default
|
Tensor |
insert(String key,
Tensor param) |
StringVector |
keys()
Return the keys in the dict
|
Tensor |
pop(BytePointer key)
Remove key from the ParameterDict and return its value, throw exception
if the key is not contained.
|
Tensor |
pop(String key) |
void |
pretty_print(Pointer stream)
Pretty prints the
ParameterDict module into the given stream . |
void |
reset()
reset() is empty for ParameterDict , since it does not have
parameters of its own. |
long |
size()
Return the number of items currently stored in the ParameterDict
|
TensorVector |
values()
Return the Values in the dict
|
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 ParameterDictImpl(Pointer p)
Pointer(Pointer)
.public ParameterDictImpl(Module pointer)
public ParameterDictImpl()
public ParameterDictImpl(@Const @ByRef StringTensorDict params)
public void reset()
reset()
is empty for ParameterDict
, since it does not have
parameters of its own.reset
in class ParameterDictImplCloneable
public void pretty_print(@Cast(value="std::ostream*") @ByRef Pointer stream)
ParameterDict
module into the given stream
.pretty_print
in class Module
@ByRef public Tensor insert(@StdString BytePointer key, @ByVal Tensor param)
@ByVal public Tensor pop(@StdString BytePointer key)
@ByVal public Tensor pop(@StdString String key)
@ByVal public StringVector keys()
@Cast(value={"","std::vector<torch::Tensor>"}) @StdMove public TensorVector values()
@ByVal @Cast(value="torch::nn::ParameterDictImpl::Iterator*") public StringTensorDictItemVector.Iterator begin()
@ByVal @Cast(value="torch::nn::ParameterDictImpl::Iterator*") public StringTensorDictItemVector.Iterator end()
@Cast(value="size_t") @NoException(value=true) public long size()
@Cast(value="bool") @NoException(value=true) public boolean empty()
public void clear()
@Cast(value="bool") @NoException(value=true) public boolean contains(@StdString BytePointer key)
@Cast(value="bool") @NoException(value=true) public boolean contains(@StdString String key)
@ByRef public Tensor get(@StdString BytePointer key)
key
. Throws an exception if
no such key is stored in the ParameterDict
. Check contains(key) before
for a non-throwing way of access@ByRef public Tensor get(@StdString String key)
Copyright © 2024. All rights reserved.