OutputShapeDependOnCompute
Function Usage
Registers the list of output shapes that depend on the computation results. For NonZero (counting the number of non-zero values in a tensor), the output shape information of the operator cannot be obtained before the computation is complete. When defining the prototype of this type of operator, you need to use the OutputShapeDependOnCompute API to identify the operator, and write the actual output shape to the output parameters in the operator kernel function so that the framework can manage the output memory based on the information.
Prototype
1 | OpImplRegisterV2 &OutputShapeDependOnCompute(std::initializer_list<int32_t> outputs) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
outputs |
Input |
List of output indexes. |
Returns
OpImplRegisterV2 object of the operator, where the list of output shapes depending on the computation results is registered.
Constraints
- It can only be used to identify the operator output.
Parent topic: OpImplRegisterV2