Package org.apache.tvm.contrib
Class GraphModule
java.lang.Object
org.apache.tvm.contrib.GraphModule
Wrapper runtime module.
This is a thin wrapper of the underlying TVM module.
you can also directly call set_input, run, and get_output
of underlying module functions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondebugGetOutput
(int node, NDArray out) Run graph up to node and get the output to out.debugGetOutput
(String node, NDArray out) Run graph up to node and get the output to out.getFunction
(String key) Get internal module function.Get index-th input to out.Get index-th output to out.loadParams
(byte[] params) Load parameters from serialized byte array of parameter dict.void
release()
Release the GraphModule.run()
Run forward execution of the graph.Set inputs to the module.Set inputs to the module.
-
Constructor Details
-
GraphModule
-
-
Method Details
-
release
public void release()Release the GraphModule.We highly recommend you to do this manually since the GC strategy is lazy.
-
setInput
Set inputs to the module.- Parameters:
key
- The input key.value
- The input value- Returns:
- self.
-
setInput
Set inputs to the module.- Parameters:
key
- The input key.value
- The input value.- Returns:
- self.
-
run
Run forward execution of the graph.- Returns:
- self.
-
getInput
Get index-th input to out.- Parameters:
index
- The input index.out
- The output array container.- Returns:
- out.
-
getOutput
Get index-th output to out.- Parameters:
index
- The output index.out
- The output array container.- Returns:
- out.
-
debugGetOutput
Run graph up to node and get the output to out.- Parameters:
node
- The node name.out
- The output array container.- Returns:
- out.
-
debugGetOutput
Run graph up to node and get the output to out.- Parameters:
node
- The node index.out
- The output array container.- Returns:
- out.
-
loadParams
Load parameters from serialized byte array of parameter dict.- Parameters:
params
- The serialized parameter.- Returns:
- self.
-
getFunction
Get internal module function.- Parameters:
key
- The key to the module.- Returns:
- The function.
- Throws:
IllegalArgumentException
- if function does not exist.
-