@Name(value="torch::jit::Module") @NoOffset @Properties(inherit=torch.class) public class JitModule extends JitObject
JitObject.Property
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
JitModule() |
JitModule(CompilationUnit cu,
ClassType type) |
JitModule(JitModule arg0) |
JitModule(long size)
Native array allocator.
|
JitModule(Pointer module_value) |
JitModule(QualifiedName class_name) |
JitModule(QualifiedName arg0,
CompilationUnit cu) |
JitModule(QualifiedName arg0,
CompilationUnit cu,
boolean shouldMangle) |
Modifier and Type | Method and Description |
---|---|
void |
_save_for_mobile(BytePointer filename) |
void |
_save_for_mobile(BytePointer filename,
ExtraFilesMap extra_files,
boolean save_mobile_debug_info,
boolean use_flatbuffer) |
void |
_save_for_mobile(Pointer out) |
void |
_save_for_mobile(Pointer out,
ExtraFilesMap extra_files,
boolean save_mobile_debug_info,
boolean use_flatbuffer) |
void |
_save_for_mobile(String filename) |
void |
_save_for_mobile(String filename,
ExtraFilesMap extra_files,
boolean save_mobile_debug_info,
boolean use_flatbuffer) |
IValue |
apply(IValueVector inputs) |
void |
apply(JitModuleApplyFunction fn) |
attribute_list |
attributes() |
attribute_list |
attributes(boolean recurse) |
buffer_list |
buffers() |
buffer_list |
buffers(boolean recurse) |
module_list |
children() |
void |
clone_method(JitModule orig,
BytePointer name) |
void |
clone_method(JitModule orig,
String name) |
JitModule |
clone() |
JitModule |
clone(boolean inplace) |
JitModule |
clone(boolean inplace,
StringSet ignored_method,
StringSet ignored_attributes) |
JitModule |
copy() |
IValue |
create_class(QualifiedName name,
IValueVector stack) |
JitModule |
deepcopy() |
JitModule |
deepcopy(DeviceOptional device) |
BytePointer |
dump_to_str(boolean print_method_bodies,
boolean print_attr_values,
boolean print_param_values) |
void |
dump(boolean print_method_bodies,
boolean print_attr_values,
boolean print_param_values) |
boolean |
equals(JitModule y) |
void |
eval()
Calls train(false) to enable "eval" mode.
|
IValue |
forward(IValueVector inputs) |
IValue |
forward(IValueVector inputs,
StringIValueMap kwargs) |
JitModule |
getPointer(long i) |
boolean |
is_optimized() |
boolean |
is_training()
True if the module is in training mode.
|
module_list |
modules() |
named_attribute_list |
named_attributes() |
named_attribute_list |
named_attributes(boolean recurse) |
named_buffer_list |
named_buffers() |
named_buffer_list |
named_buffers(boolean recurse) |
named_module_list |
named_children() |
named_module_list |
named_modules() |
named_parameter_list |
named_parameters() |
named_parameter_list |
named_parameters(boolean recurse) |
parameter_list |
parameters() |
parameter_list |
parameters(boolean recurse) |
JitModule |
position(long position) |
JitModule |
put(JitModule arg0) |
void |
register_attribute(BytePointer name,
Type.TypePtr t,
IValue v) |
void |
register_attribute(BytePointer name,
Type.TypePtr t,
IValue v,
boolean is_param,
boolean is_buffer) |
void |
register_attribute(String name,
Type.TypePtr t,
IValue v) |
void |
register_attribute(String name,
Type.TypePtr t,
IValue v,
boolean is_param,
boolean is_buffer) |
void |
register_buffer(BytePointer name,
Tensor v) |
void |
register_buffer(String name,
Tensor v) |
void |
register_module(BytePointer name,
JitModule module) |
void |
register_module(String name,
JitModule module) |
void |
register_parameter(BytePointer name,
Tensor v,
boolean is_buffer) |
void |
register_parameter(String name,
Tensor v,
boolean is_buffer) |
StringGenericListDict |
retrieve_traced_inputs() |
void |
save(BytePointer filename) |
void |
save(BytePointer filename,
ExtraFilesMap extra_files) |
void |
save(Pointer out) |
void |
save(Pointer out,
ExtraFilesMap extra_files) |
void |
save(String filename) |
void |
save(String filename,
ExtraFilesMap extra_files) |
void |
set_delete_memory(byte[] delete_mem) |
void |
set_delete_memory(ByteBuffer delete_mem) |
void |
set_delete_memory(BytePointer delete_mem) |
void |
set_optimized(boolean o) |
void |
store_traced_inputs(BytePointer func_name,
IValueVector inputs) |
void |
store_traced_inputs(String func_name,
IValueVector inputs) |
void |
to(Device device) |
void |
to(Device device,
boolean non_blocking)
Recursively moves all parameters to the given device.
|
void |
to(Device device,
torch.ScalarType dtype) |
void |
to(Device device,
torch.ScalarType dtype,
boolean non_blocking)
Recursively casts all parameters to the given
dtype and device . |
void |
to(torch.ScalarType dtype) |
void |
to(torch.ScalarType dtype,
boolean non_blocking)
Recursively casts all parameters to the given dtype.
|
void |
train() |
void |
train(boolean on)
Enables "training" mode.
|
_ivalue, attr, attr, attr, attr, define, define, define, define, find_method, find_method, get_method, get_method, get_methods, get_properties, get_property, get_property, has_property, has_property, hasattr, hasattr, num_slots, put, setattr, setattr, type
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 JitModule(long size)
Pointer.position(long)
.public JitModule(@ByVal QualifiedName class_name)
public JitModule(@SharedPtr CompilationUnit cu, @Const @SharedPtr(value="c10::ClassType") @ByRef ClassType type)
public JitModule()
public JitModule(@ByVal QualifiedName arg0, @SharedPtr CompilationUnit cu, @Cast(value="bool") boolean shouldMangle)
public JitModule(@ByVal QualifiedName arg0, @SharedPtr CompilationUnit cu)
public JitModule getPointer(long i)
getPointer
in class JitObject
@ByVal public IValue forward(@ByVal IValueVector inputs, @Cast(value="const torch::jit::Kwargs*") @ByRef(nullValue="torch::jit::Kwargs()") StringIValueMap kwargs)
@ByVal public IValue forward(@ByVal IValueVector inputs)
public void register_buffer(@StdString BytePointer name, @ByVal Tensor v)
public void register_buffer(@StdString String name, @ByVal Tensor v)
public void register_parameter(@StdString BytePointer name, @ByVal Tensor v, @Cast(value="bool") boolean is_buffer)
public void register_parameter(@StdString String name, @ByVal Tensor v, @Cast(value="bool") boolean is_buffer)
public void register_attribute(@StdString BytePointer name, @Const @ByRef Type.TypePtr t, @ByVal IValue v, @Cast(value="bool") boolean is_param, @Cast(value="bool") boolean is_buffer)
public void register_attribute(@StdString BytePointer name, @Const @ByRef Type.TypePtr t, @ByVal IValue v)
public void register_attribute(@StdString String name, @Const @ByRef Type.TypePtr t, @ByVal IValue v, @Cast(value="bool") boolean is_param, @Cast(value="bool") boolean is_buffer)
public void register_attribute(@StdString String name, @Const @ByRef Type.TypePtr t, @ByVal IValue v)
public void register_module(@StdString BytePointer name, @Const @ByRef JitModule module)
public void register_module(@StdString String name, @Const @ByRef JitModule module)
public void apply(@Const @ByRef JitModuleApplyFunction fn)
@ByVal public buffer_list buffers(@Cast(value="bool") boolean recurse)
@ByVal public buffer_list buffers()
@ByVal public named_buffer_list named_buffers(@Cast(value="bool") boolean recurse)
@ByVal public named_buffer_list named_buffers()
@ByVal public module_list children()
@ByVal public named_module_list named_children()
@ByVal public module_list modules()
@ByVal public named_module_list named_modules()
@ByVal public parameter_list parameters(@Cast(value="bool") boolean recurse)
@ByVal public parameter_list parameters()
@ByVal public named_parameter_list named_parameters(@Cast(value="bool") boolean recurse)
@ByVal public named_parameter_list named_parameters()
@ByVal public attribute_list attributes(@Cast(value="bool") boolean recurse)
@ByVal public attribute_list attributes()
@ByVal public named_attribute_list named_attributes(@Cast(value="bool") boolean recurse)
@ByVal public named_attribute_list named_attributes()
public void dump(@Cast(value="bool") boolean print_method_bodies, @Cast(value="bool") boolean print_attr_values, @Cast(value="bool") boolean print_param_values)
@StdString public BytePointer dump_to_str(@Cast(value="bool") boolean print_method_bodies, @Cast(value="bool") boolean print_attr_values, @Cast(value="bool") boolean print_param_values)
public void train()
public void eval()
train()
instead.@Cast(value="bool") public boolean is_training()
public void to(@ByVal Device device, torch.ScalarType dtype, @Cast(value="bool") boolean non_blocking)
dtype
and device
.
If non_blocking
is true and the source is in pinned memory and
destination is on the GPU or vice versa, the copy is performed
asynchronously with respect to the host. Otherwise, the argument has no
effect.public void to(@ByVal Device device, torch.ScalarType dtype)
public void to(torch.ScalarType dtype, @Cast(value="bool") boolean non_blocking)
non_blocking
is true and the source is in pinned memory and
destination is on the GPU or vice versa, the copy is performed
asynchronously with respect to the host. Otherwise, the argument has no
effect.public void to(torch.ScalarType dtype)
public void to(@ByVal Device device, @Cast(value="bool") boolean non_blocking)
non_blocking
is true and the source is in pinned memory and
destination is on the GPU or vice versa, the copy is performed
asynchronously with respect to the host. Otherwise, the argument has no
effect.public void save(@Cast(value="std::ostream*") @ByRef Pointer out, @Const @ByRef(nullValue="torch::jit::ExtraFilesMap()") ExtraFilesMap extra_files)
public void save(@StdString BytePointer filename, @Const @ByRef(nullValue="torch::jit::ExtraFilesMap()") ExtraFilesMap extra_files)
public void save(@StdString BytePointer filename)
public void save(@StdString String filename, @Const @ByRef(nullValue="torch::jit::ExtraFilesMap()") ExtraFilesMap extra_files)
public void save(@StdString String filename)
public void _save_for_mobile(@Cast(value="std::ostream*") @ByRef Pointer out, @Const @ByRef(nullValue="torch::jit::ExtraFilesMap()") ExtraFilesMap extra_files, @Cast(value="bool") boolean save_mobile_debug_info, @Cast(value="bool") boolean use_flatbuffer)
public void _save_for_mobile(@StdString BytePointer filename, @Const @ByRef(nullValue="torch::jit::ExtraFilesMap()") ExtraFilesMap extra_files, @Cast(value="bool") boolean save_mobile_debug_info, @Cast(value="bool") boolean use_flatbuffer)
public void _save_for_mobile(@StdString BytePointer filename)
public void _save_for_mobile(@StdString String filename, @Const @ByRef(nullValue="torch::jit::ExtraFilesMap()") ExtraFilesMap extra_files, @Cast(value="bool") boolean save_mobile_debug_info, @Cast(value="bool") boolean use_flatbuffer)
public void _save_for_mobile(@StdString String filename)
@ByVal public JitModule deepcopy(@ByVal(nullValue="c10::optional<at::Device>(c10::nullopt)") DeviceOptional device)
@ByVal public JitModule clone(@Cast(value="bool") boolean inplace, @Const @ByRef StringSet ignored_method, @Const @ByRef StringSet ignored_attributes)
public void clone_method(@Const @ByRef JitModule orig, @StdString BytePointer name)
public void clone_method(@Const @ByRef JitModule orig, @StdString String name)
@ByVal public IValue create_class(@Const @ByRef QualifiedName name, @ByVal IValueVector stack)
@Cast(value="bool") @Name(value="operator ==") @NoException(value=true) public boolean equals(@Const @ByRef JitModule y)
public void set_delete_memory(@Cast(value="char*") @SharedPtr BytePointer delete_mem)
public void set_delete_memory(@Cast(value="char*") @SharedPtr ByteBuffer delete_mem)
public void set_delete_memory(@Cast(value="char*") @SharedPtr byte[] delete_mem)
public void store_traced_inputs(@StdString BytePointer func_name, @ByVal IValueVector inputs)
public void store_traced_inputs(@StdString String func_name, @ByVal IValueVector inputs)
@ByVal public StringGenericListDict retrieve_traced_inputs()
Copyright © 2024. All rights reserved.