@Name(value="torch::OrderedDict<std::string,std::shared_ptr<torch::nn::Module> >") @NoOffset @Properties(inherit=torch.class) public class StringSharedModuleDict extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
StringSharedModuleDict() |
StringSharedModuleDict(BytePointer key_description)
Constructs the
OrderedDict with a short description of the kinds of keys
stored in the OrderedDict. |
StringSharedModuleDict(long size)
Native array allocator.
|
StringSharedModuleDict(Pointer p)
Pointer cast constructor.
|
StringSharedModuleDict(String key_description) |
StringSharedModuleDict(StringSharedModuleDict other)
Copy constructs this
OrderedDict from other. |
| Modifier and Type | Method and Description |
|---|---|
StringSharedModuleDictItem |
back()
Returns the very last item in the
OrderedDict and throws an exception
if it is empty. |
StringSharedModuleDictItemVector.Iterator |
begin()
Returns an iterator to the first item in the
OrderedDict. |
void |
clear()
Removes all items from this
OrderedDict. |
boolean |
contains(BytePointer key)
Returns true if the key is present in the
OrderedDict. |
boolean |
contains(String key) |
StringSharedModuleDictItemVector.Iterator |
end()
Returns an iterator one past the last item in the
OrderedDict. |
void |
erase(BytePointer key)
Removes the item that has
key from this OrderedDict if exists and if
it doesn't an exception is thrown. |
void |
erase(String key) |
Module |
find(BytePointer key)
Returns a pointer to the value associated with the given key, or a
nullptr if no such key is stored in the OrderedDict. |
Module |
find(String key) |
StringSharedModuleDictItem |
front()
Returns the very first item in the
OrderedDict and throws an exception
if it is empty. |
Module |
get(BytePointer key)
Returns the value associated with the given
key. |
StringSharedModuleDictItem |
get(long index)
Returns the item at the
index-th position in the OrderedDict. |
Module |
get(String key) |
StringSharedModuleDict |
getPointer(long i) |
Module |
insert(BytePointer key,
Module value)
Inserts a new
(key, value) pair into the OrderedDict. |
Module |
insert(String key,
Module value) |
boolean |
is_empty()
Returns true if the
OrderedDict contains no elements. |
StringSharedModuleDictItemVector |
items()
Returns the items stored in the
OrderedDict. |
BytePointer |
key_description()
Returns the key description string the
OrderedDict was constructed with. |
StringVector |
keys()
Returns a newly allocated vector and copies all keys from this
OrderedDict into the vector. |
StringSharedModuleVector |
pairs()
Returns a newly allocated vector and copies all keys and values from this
OrderedDict into a vector of std::pair<Key, Value>. |
StringSharedModuleDict |
position(long position) |
StringSharedModuleDict |
put(StringSharedModuleDict other)
Assigns items from
other to this OrderedDict. |
void |
reserve(long requested_capacity)
Resizes internal storage to fit at least
requested_capacity items
without requiring reallocation. |
long |
size()
Returns the number of items currently stored in the
OrderedDict. |
void |
update(StringSharedModuleDict other)
Inserts all items from
other into this OrderedDict. |
SharedModuleVector |
values()
Returns a newly allocated vector and copies all values from this
OrderedDict into the vector. |
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, zeropublic StringSharedModuleDict(Pointer p)
Pointer(Pointer).public StringSharedModuleDict(long size)
Pointer.position(long).public StringSharedModuleDict(@StdString BytePointer key_description)
OrderedDict with a short description of the kinds of keys
stored in the OrderedDict. This description is used in error messages
thrown by the OrderedDict.public StringSharedModuleDict()
public StringSharedModuleDict(@StdString String key_description)
public StringSharedModuleDict(@Const @ByRef StringSharedModuleDict other)
OrderedDict from other.public StringSharedModuleDict position(long position)
public StringSharedModuleDict getPointer(long i)
getPointer in class Pointer@ByRef @Name(value="operator =") public StringSharedModuleDict put(@Const @ByRef StringSharedModuleDict other)
other to this OrderedDict.@StdString @NoException(value=true) public BytePointer key_description()
OrderedDict was constructed with.@ByRef public StringSharedModuleDictItem front()
OrderedDict and throws an exception
if it is empty.@ByRef public StringSharedModuleDictItem back()
OrderedDict and throws an exception
if it is empty.@ByRef @Name(value="operator []") public StringSharedModuleDictItem get(@Cast(value="size_t") long index)
index-th position in the OrderedDict. Throws
an exception if the index is out of bounds.@SharedPtr(value="torch::nn::Module") @ByRef @Name(value="operator []") public Module get(@StdString BytePointer key)
key. Throws an exception if
no such key is stored in the OrderedDict. Use find() for a
non-throwing way of accessing a value if it is present.@SharedPtr(value="torch::nn::Module") @ByRef @Name(value="operator []") public Module get(@StdString String key)
@SharedPtr(value="torch::nn::Module") @NoException(value=true) public Module find(@StdString BytePointer key)
nullptr if no such key is stored in the OrderedDict.@SharedPtr(value="torch::nn::Module") @NoException(value=true) public Module find(@StdString String key)
@Cast(value="bool") @NoException(value=true) public boolean contains(@StdString BytePointer key)
OrderedDict.@Cast(value="bool") @NoException(value=true) public boolean contains(@StdString String key)
@ByVal @Cast(value="torch::OrderedDict<std::string,std::shared_ptr<torch::nn::Module> >::Iterator*") public StringSharedModuleDictItemVector.Iterator begin()
OrderedDict. Iteration is
ordered.@ByVal @Cast(value="torch::OrderedDict<std::string,std::shared_ptr<torch::nn::Module> >::Iterator*") public StringSharedModuleDictItemVector.Iterator end()
OrderedDict.@Cast(value="size_t") @NoException(value=true) public long size()
OrderedDict.@Cast(value="bool") @NoException(value=true) public boolean is_empty()
OrderedDict contains no elements.public void reserve(@Cast(value="size_t") long requested_capacity)
requested_capacity items
without requiring reallocation.public Module insert(BytePointer key, Module value)
(key, value) pair into the OrderedDict. Throws an
exception if the key is already present. If insertion is successful,
immediately returns a reference to the inserted value.public void update(@ByRef(value=true) StringSharedModuleDict other)
other into this OrderedDict. If any key from
other is already present in this OrderedDict, an exception is thrown.public void erase(@StdString BytePointer key)
key from this OrderedDict if exists and if
it doesn't an exception is thrown.public void erase(@StdString String key)
public void clear()
OrderedDict.@Const @ByRef @NoException(value=true) public StringSharedModuleDictItemVector items()
OrderedDict.@ByVal public StringVector keys()
OrderedDict into the vector.@ByVal public SharedModuleVector values()
OrderedDict into the vector.@ByVal public StringSharedModuleVector pairs()
OrderedDict into a vector of std::pair<Key, Value>.Copyright © 2024. All rights reserved.