Generates a diagonal tensor. If the input [object Object] is a 1D tensor, the operator returns a 2D tensor by using elements of [object Object] as the diagonal. If the input is a 2D or multi-dimensional tensor, the operator flattens the input into a 1D tensor and then processes it accordingly.
Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.
Parameters
[object Object]Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following error codes may be returned:
[object Object]
- Deterministic computation:
[object Object]defaults to a deterministic implementation.
Note: The aclnnDiagFlat API does not support backward computation.
The following example is for reference only. For details, see .