run_graph_with_stream_async

Function Usage

Runs a graph asynchronously.

Prototype

1
run_graph_with_stream_async(graph_id: int, stream: int, inputs: List[Tensor]) -> List[Tensor]

Parameters

Parameter

Input/Output

Description

graph_id

Input

Graph ID

stream

Input

Stream on which the graph is run

inputs

Input

Input tensor list, which is the memory space on the device

Returns

(List[Tensor]) Output tensor list, which is the memory space on the device

Restrictions

  • If graph_id is not an integer, TypeError is thrown.
  • If stream is not an integer, TypeError is thrown.
  • If any element in inputs is not of the tensor type, TypeError is thrown.
  • If the execution fails, RuntimeError is thrown.
  • Before calling this API, you need to create a stream by calling acl.rt.create_stream() provided by ACL. Only the scenario where the stream uses the default context is supported. Before obtaining the output result, you need to call acl.rt.synchronize_stream to ensure that the tasks on the stream have been executed. For details about the API, see Stream Management.