public class GraphInferenceGrpcClient extends Object
Constructor and Description |
---|
GraphInferenceGrpcClient(@NonNull io.grpc.ManagedChannel channel)
This method creates new GraphInferenceGrpcClient over given ManagedChannel
|
GraphInferenceGrpcClient(@NonNull String host,
int port)
This method creates new GraphInferenceGrpcClient, with plain text connection
|
GraphInferenceGrpcClient(@NonNull String host,
int port,
boolean useTLS)
This method creates new GraphInferenceGrpcClient, with optional TLS support
|
Modifier and Type | Method and Description |
---|---|
void |
dropGraph(long graphId)
This method allows to remove graph from the GraphServer instance
|
Operands |
output(long graphId,
@NonNull Operands operands) |
INDArray[] |
output(long graphId,
Pair<String,INDArray>... inputs)
This method sends inference request to the GraphServer instance, and returns result as array of INDArrays
|
<T> T |
output(long graphId,
T value,
OperandsAdapter<T> adapter)
This method is suited for use of custom OperandsAdapters
|
INDArray[] |
output(Pair<String,INDArray>... inputs)
This method sends inference request to the GraphServer instance, and returns result as array of INDArrays
PLEASE NOTE: This call will be routed to default graph with id 0
|
void |
registerGraph(long graphId,
@NonNull SameDiff graph,
ExecutorConfiguration configuration)
This method adds given graph to the GraphServer storage
PLEASE NOTE: You don't need to register graph more then once
PLEASE NOTE: You don't need to register graph if GraphServer was used with -f argument
|
void |
registerGraph(@NonNull SameDiff graph)
This method adds given graph to the GraphServer storage
|
void |
shutdown()
This method shuts down gRPC connection
|
public GraphInferenceGrpcClient(@NonNull @NonNull String host, int port)
host
- port
- public GraphInferenceGrpcClient(@NonNull @NonNull String host, int port, boolean useTLS)
host
- port
- public GraphInferenceGrpcClient(@NonNull @NonNull io.grpc.ManagedChannel channel)
channel
- public void shutdown() throws InterruptedException
InterruptedException
public void registerGraph(@NonNull @NonNull SameDiff graph)
graph
- public void registerGraph(long graphId, @NonNull @NonNull SameDiff graph, ExecutorConfiguration configuration)
graphId
- id of the graph, if not 0 - should be used in subsequent output() requestsgraph
- public INDArray[] output(Pair<String,INDArray>... inputs)
inputs
- graph inputs with their string idespublic <T> T output(long graphId, T value, OperandsAdapter<T> adapter)
T
- adapter
- public INDArray[] output(long graphId, Pair<String,INDArray>... inputs)
graphId
- id of the graphinputs
- graph inputs with their string idespublic void dropGraph(long graphId)
graphId
- Copyright © 2020. All rights reserved.