目录

TryGetInputDesc

Function Description

Obtains TensorDesc of an operator input based on the input name.

Function Prototype

APIs taking string arguments will be deprecated in future releases. Use APIs taking non-string arguments instead.

graphStatus TryGetInputDesc(const std::string &name, TensorDesc &tensor_desc) const;
graphStatus TryGetInputDesc(const char_t *name, TensorDesc &tensor_desc) const;

Parameters

Parameter Input/Output Description
name Input Name of the operator input.
tensor_desc Output Current format of the operator port, which is a TensorDesc object.

Return Value

Type Description
graphStatus

GRAPH_SUCCESS: The port exists and the TensorDesc object is successfully obtained.

GRAPH_FAILED: The port does not exist, the output parameter is empty, and TensorDesc fails to be obtained.

Exception Handling

Exception Scenario Description
No input corresponding to the name. Returns GRAPH_FAILED.

Restrictions

None