public class GraphModule extends Object
| Modifier and Type | Method and Description |
|---|---|
NDArray |
debugGetOutput(int node,
NDArray out)
Run graph up to node and get the output to out.
|
NDArray |
debugGetOutput(String node,
NDArray out)
Run graph up to node and get the output to out.
|
Function |
getFunction(String key)
Get internal module function.
|
NDArray |
getInput(int index,
NDArray out)
Get index-th input to out.
|
NDArray |
getOutput(int index,
NDArray out)
Get index-th output to out.
|
GraphModule |
loadParams(byte[] params)
Load parameters from serialized byte array of parameter dict.
|
void |
release()
Release the GraphModule.
|
GraphModule |
run()
Run forward execution of the graph.
|
GraphModule |
setInput(int key,
NDArray value)
Set inputs to the module.
|
GraphModule |
setInput(String key,
NDArray value)
Set inputs to the module.
|
public void release()
We highly recommend you to do this manually since the GC strategy is lazy.
public GraphModule setInput(String key, NDArray value)
key - The input key.value - The input valuepublic GraphModule setInput(int key, NDArray value)
key - The input key.value - The input value.public GraphModule run()
public NDArray getInput(int index, NDArray out)
index - The input index.out - The output array container.public NDArray getOutput(int index, NDArray out)
index - The output index.out - The output array container.public NDArray debugGetOutput(String node, NDArray out)
node - The node name.out - The output array container.public NDArray debugGetOutput(int node, NDArray out)
node - The node index.out - The output array container.public GraphModule loadParams(byte[] params)
params - The serialized parameter.public Function getFunction(String key)
key - The key to the module.IllegalArgumentException - if function does not exist.Copyright © 2021. All rights reserved.