- Description: Fills the diagonal of a tensor with
[object Object]. - Calculation formula: Take a two-dimensional model as an example. When
[object Object]is[object Object], the filling position is[object Object], where[object Object],[object Object], and[object Object]is the column length and row is the row length. When[object Object]is[object Object], the filling position is[object Object], where[object Object],[object Object],[object Object]is the column length,[object Object]is the row length, and[object Object].
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
[object Object][object Object]
Parameters
[object Object](aclTensor*, computation input/output): input/output tensor, aclTensor on the device. are supported. The can be ND.- [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: The data type can be FLOAT16, FLOAT, DOUBLE, INT8, INT16, INT32, INT64, UINT8, or BOOL.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be BFLOAT16, FLOAT16, FLOAT, DOUBLE, INT8, INT16, INT32, INT64, UINT8, or BOOL.
[object Object](aclScalar*, computation input): filling value, aclScalar on the host. The data type must be convertible to FLOAT.[object Object](bool, computation input): filling mode,[object Object]in the formula, BOOL on the host. For a high matrix (row > col), if[object Object]is[object Object], a new diagonal line is formed every[object Object]rows, where[object Object].[object Object](uint64_t*, output): size of the workspace to be allocated on the device.[object Object](aclOpExecutor**, output): operator executor, containing the operator computation process.
Returns:
[object Object]
Parameters
[object Object](void*, input): address of the workspace to be allocated on the device.[object Object](uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API[object Object].[object Object](aclOpExecutor*, input): operator executor, containing the operator computation process.[object Object](aclrtStream, input): stream for executing the task.
Returns:
Deterministic computing:
[object Object]defaults to a deterministic implementation.
[object Object](aclTensor*, computation input/output): When the total number of bytes of aclTensor exceeds 2^31 bytes (that is, 2 GB), the operator execution times out.
The following example is for reference only. For details, see .
[object Object]