[object Object]

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

Description: Flattens the input tensor into a 2D tensor based on the given axis.

  • If the shape of [object Object] is (d_0, d_1, ..., d_n), the shape of [object Object] is (d_0*d_1 ... *d_(axis-1), d_axis*d_(axis+1)... *d_n).
  • If the value of [object Object] is 0, the shape of [object Object] is (1, d_0*d_1 ... *d_n).
[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] (aclTensor*, compute input): input [object Object]. are supported. The can be ND. The shape ranges from 2D to 8D.

      • [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 INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64, BOOL, BFLOAT16, FLOAT, or FLOAT16.
      • [object Object]Atlas training products[object Object]: The data type can be INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64, BOOL, FLOAT, or FLOAT16.
    • [object Object] (int64_t, compute input): input [object Object], which is an int64_t integer. It indicates the base axis for the flatten operation. The value range is [object Object]. Currently, only [object Object] is supported.

    • [object Object] (aclTensor*, compute output): output [object Object]. The shape is 2D. are supported. The can be ND.

      • [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 INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64, BOOL, BFLOAT16, FLOAT, or FLOAT16.
      • [object Object]Atlas training products[object Object]: The data type can be INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64, BOOL, FLOAT, or FLOAT16.
    • [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]: status code. For details, see .

[object Object]
[object Object]
  • Parameters:

    • [object Object] (void*, input): memory 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 calling 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:

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

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

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

[object Object]