GetOutputDesc
Function Usage
Obtains the output tensor description based on the operator output index. The output index refers to the actual index after operator instantiation, not the index in the prototype definition.
Prototype
1 | const CompileTimeTensorDesc *GetOutputDesc(const size_t index) const |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
index |
Input |
Operator output index, starting from 0. |
Returns
Pointer to the output TensorDesc. If the input index is invalid, a null pointer is returned.
For details about the definition of CompileTimeTensorDesc, see CompileTimeTensorDesc.
Constraints
None
Examples
1 2 3 4 5 6 | // Assume that KernelContext *context already exists. auto extend_context = reinterpret_cast<ExtendedKernelContext *>(context); for (size_t idx = 0; idx < extend_context->GetComputeNodeInfo()->GetOutputsNum(); ++idx) { auto output_td = extend_context->GetOutputDesc(idx); ... } |
Parent topic: ExtendedKernelContext