[object Object]

[object Object][object Object]undefined
[object Object]

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.

[object Object]

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.

[object Object]
[object Object]
[object Object]
  • 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]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic computation:
    • [object Object] defaults to a deterministic implementation.

Note: The aclnnDiagFlat API does not support backward computation.

[object Object]

The following example is for reference only. For details, see .

[object Object]