Module
Methods
destroy
-
public void
destroy
() Explicitly destroys the native torch::jit::script::Module. Calling this method is not required, as the native object will be destroyed when this object is garbage-collected. However, the timing of garbage collection is not guaranteed, so proactively calling
destroy
can free memory more quickly. Seecom.facebook.jni.HybridData.resetNative
.
load
-
public static Module
load
(String modelPath) Loads a serialized TorchScript module from the specified path on the disk.
- Parameters
modelPath – path to file that contains the serialized TorchScript module.
- Returns
new
org.pytorch.Module
object which owns torch::jit::script::Module.