@Namespace(value="torch::serialize") @NoOffset @Properties(inherit=torch.class) public class InputArchive extends Pointer
torch::load
.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
InputArchive()
Default-constructs the
InputArchive . |
InputArchive(InputArchive arg0) |
InputArchive(long size)
Native array allocator.
|
InputArchive(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
InputArchive |
getPointer(long i) |
StringVector |
keys() |
void |
load_from(BytePointer filename) |
void |
load_from(BytePointer filename,
DeviceOptional device)
Loads the
InputArchive from a serialized representation stored in the
file at filename . |
void |
load_from(BytePointer data,
long size) |
void |
load_from(BytePointer data,
long size,
DeviceOptional device) |
void |
load_from(Pointer stream) |
void |
load_from(Pointer stream,
DeviceOptional device)
Loads the
InputArchive from a serialized representation stored in the
given stream . |
void |
load_from(Reader read_func,
SizeTSupplier size_func) |
void |
load_from(Reader read_func,
SizeTSupplier size_func,
DeviceOptional device) |
void |
load_from(String filename) |
void |
load_from(String filename,
DeviceOptional device) |
void |
load_from(String data,
long size) |
void |
load_from(String data,
long size,
DeviceOptional device) |
InputArchive |
position(long position) |
void |
read(BytePointer key,
InputArchive archive)
Reads an
InputArchive associated with a given key . |
void |
read(BytePointer key,
IValue ivalue)
Reads an
IValue associated with a given key . |
void |
read(BytePointer key,
Tensor tensor) |
void |
read(BytePointer key,
Tensor tensor,
boolean is_buffer)
Reads a
tensor associated with a given key . |
void |
read(String key,
InputArchive archive) |
void |
read(String key,
IValue ivalue) |
void |
read(String key,
Tensor tensor) |
void |
read(String key,
Tensor tensor,
boolean is_buffer) |
boolean |
try_read(BytePointer key,
InputArchive archive)
Reads a
InputArchive associated with a given key . |
boolean |
try_read(BytePointer key,
IValue ivalue)
Reads an
IValue associated with a given key . |
boolean |
try_read(BytePointer key,
Tensor tensor) |
boolean |
try_read(BytePointer key,
Tensor tensor,
boolean is_buffer)
Reads a
tensor associated with a given key . |
boolean |
try_read(String key,
InputArchive archive) |
boolean |
try_read(String key,
IValue ivalue) |
boolean |
try_read(String key,
Tensor tensor) |
boolean |
try_read(String key,
Tensor tensor,
boolean is_buffer) |
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, zero
public InputArchive(Pointer p)
Pointer(Pointer)
.public InputArchive(long size)
Pointer.position(long)
.public InputArchive()
InputArchive
.public InputArchive(@ByRef(value=true) InputArchive arg0)
public InputArchive position(long position)
public InputArchive getPointer(long i)
getPointer
in class Pointer
public void read(@StdString BytePointer key, @ByRef IValue ivalue)
IValue
associated with a given key
.public void read(@StdString String key, @ByRef IValue ivalue)
@Cast(value="bool") public boolean try_read(@StdString BytePointer key, @ByRef IValue ivalue)
IValue
associated with a given key
. If there is no IValue
associated with the key
, this returns false, otherwise it returns true.@Cast(value="bool") public boolean try_read(@StdString BytePointer key, @ByRef Tensor tensor, @Cast(value="bool") boolean is_buffer)
tensor
associated with a given key
. If there is no tensor
associated with the key
, this returns false, otherwise it returns true.
If the tensor is expected to be a buffer (not differentiable), is_buffer
must be true
.@Cast(value="bool") public boolean try_read(@StdString BytePointer key, @ByRef Tensor tensor)
@Cast(value="bool") public boolean try_read(@StdString String key, @ByRef Tensor tensor, @Cast(value="bool") boolean is_buffer)
public void read(@StdString BytePointer key, @ByRef Tensor tensor, @Cast(value="bool") boolean is_buffer)
tensor
associated with a given key
.
If the tensor is expected to be a buffer (not differentiable), is_buffer
must be true
.public void read(@StdString BytePointer key, @ByRef Tensor tensor)
public void read(@StdString String key, @ByRef Tensor tensor, @Cast(value="bool") boolean is_buffer)
public void read(@StdString String key, @ByRef Tensor tensor)
@Cast(value="bool") public boolean try_read(@StdString BytePointer key, @ByRef InputArchive archive)
InputArchive
associated with a given key
. If there is no
InputArchive
associated with the key
, this returns false, otherwise
it returns true.@Cast(value="bool") public boolean try_read(@StdString String key, @ByRef InputArchive archive)
public void read(@StdString BytePointer key, @ByRef InputArchive archive)
InputArchive
associated with a given key
.
The archive can thereafter be used for further deserialization of the
nested data.public void read(@StdString String key, @ByRef InputArchive archive)
public void load_from(@StdString BytePointer filename, @ByVal(nullValue="c10::optional<torch::Device>(c10::nullopt)") DeviceOptional device)
InputArchive
from a serialized representation stored in the
file at filename
. Storage are remapped using device option. If device
is not specified, the module is loaded to the original device.public void load_from(@StdString BytePointer filename)
public void load_from(@StdString String filename, @ByVal(nullValue="c10::optional<torch::Device>(c10::nullopt)") DeviceOptional device)
public void load_from(@StdString String filename)
public void load_from(@Cast(value="std::istream*") @ByRef Pointer stream, @ByVal(nullValue="c10::optional<torch::Device>(c10::nullopt)") DeviceOptional device)
InputArchive
from a serialized representation stored in the
given stream
. Storage are remapped using device option. If device
is not specified, the module is loaded to the original device.public void load_from(@Cast(value="const char*") BytePointer data, @Cast(value="size_t") long size, @ByVal(nullValue="c10::optional<torch::Device>(c10::nullopt)") DeviceOptional device)
public void load_from(@Cast(value="const char*") BytePointer data, @Cast(value="size_t") long size)
public void load_from(String data, @Cast(value="size_t") long size, @ByVal(nullValue="c10::optional<torch::Device>(c10::nullopt)") DeviceOptional device)
public void load_from(@Const @ByRef Reader read_func, @Const @ByRef SizeTSupplier size_func, @ByVal(nullValue="c10::optional<torch::Device>(c10::nullopt)") DeviceOptional device)
public void load_from(@Const @ByRef Reader read_func, @Const @ByRef SizeTSupplier size_func)
@ByVal public StringVector keys()
Copyright © 2024. All rights reserved.