-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classModule.Companion
-
Method Summary
Modifier and Type Method Description Array<EValue>forward(EValue inputs)Runs the 'forward' method of this module with the specified arguments. Array<EValue>execute(String methodName, EValue inputs)Runs the specified method of this module with the specified arguments. UnitloadMethod(String methodName)Load a method on this module. Array<String>getMethods()Returns the names of methods. MethodMetadatagetMethodMetadata(String name)Get the corresponding MethodMetadata for a method Array<String>readLogBuffer()Retrieve the in-memory log buffer, containing the most recent ExecuTorch log entries. Booleanetdump()Dump the ExecuTorch ETRecord file to /data/local/tmp/result.etdump. Booleanetdump(String outputPath)Dump the ExecuTorch ETDump file to outputPath. Unitdestroy()Explicitly destroys the native Module object. Unitclose()-
-
Method Detail
-
forward
Array<EValue> forward(EValue inputs)
Runs the 'forward' method of this module with the specified arguments.
- Parameters:
inputs- arguments for the ExecuTorch module's 'forward' method.
-
execute
Array<EValue> execute(String methodName, EValue inputs)
Runs the specified method of this module with the specified arguments.
- Parameters:
methodName- name of the ExecuTorch method to run.inputs- arguments that will be passed to ExecuTorch method.
-
loadMethod
Unit loadMethod(String methodName)
Load a method on this module. This might help with the first time inference performance, because otherwise the method is loaded lazily when it's execute. Note: this function is synchronous, and will block until the method is loaded. Therefore, it is recommended to call this on a background thread. However, users need to make sure that they don't execute before this function returns.
-
getMethods
Array<String> getMethods()
Returns the names of methods.
-
getMethodMetadata
MethodMetadata getMethodMetadata(String name)
Get the corresponding MethodMetadata for a method
- Parameters:
name- method name
-
readLogBuffer
Array<String> readLogBuffer()
Retrieve the in-memory log buffer, containing the most recent ExecuTorch log entries.
-
etdump
Boolean etdump()
Dump the ExecuTorch ETRecord file to /data/local/tmp/result.etdump.
Currently for internal (minibench) use only.
-
etdump
Boolean etdump(String outputPath)
Dump the ExecuTorch ETDump file to outputPath.
- Parameters:
outputPath- absolute path to write the etdump file to.
-
destroy
Unit destroy()
Explicitly destroys the native Module object. 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
destroycan free memory more quickly. See com.facebook.jni.HybridData.resetNative.
-
-
-
-