[object Object]

[object Object][object Object]undefined
[object Object]
  • Function: implements the reverse function of the Unfold operator and calculates the corresponding gradient.

  • The Unfold operator computes all slices whose size is [object Object] in dimension [object Object] based on the input parameter [object Object]. The step between two slices is given by [object Object]. If [object Object] is the size of dimension [object Object] of the input parameter self, the size of dimension [object Object] in the returned tensor is (sizedimsize)/step+1(sizedim – size)/step + 1. An additional dimension whose size is [object Object] is added to the returned tensor.

  • The shape of the input [object Object] of the UnfoldGrad operator is the shape of the forward output of the Unfold operator. The shape of the input [object Object] is the shape of the forward input [object Object] of the Unfold operator. The shape of the output [object Object] of the UnfoldGrad operator is the shape of the forward input [object Object] of the Unfold operator.

  • Example:

    [object Object]
[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 verification. The following errors may be thrown:

    [object Object]
[object Object]
  • Parameter description:

    [object Object]
  • Returns:

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

[object Object]
  • Deterministic computing:
    • [object Object] defaults to a deterministic implementation.
  1. The shape of [object Object] must meet the following constraints:
    • The dimth dimension of gradOut is equal to (inputSizes[dim] – size)/step + 1.
    • The size of gradOut is equal to the size of inputSizes plus 1.
  2. Requirements for [object Object], [object Object], and [object Object]:
    • The size is greater than 0 and less than or equal to the dimth dimension of inputSizes.
    • The step is greater than 0.
    • The dim is equal to len(inputSizes) – 1 or len(inputSizes) – 2.
    • When dim is equal to len(inputSizes) – 1, the step and size are greater than 49088 for the fp32 data type. For the fp16 data type, the step and size are greater than 32720.
    • When dim is equal to len(inputSizes) – 2, the step and size are greater than 88 for the fp32 data type. For the fp16 data type, the step and size are greater than 72.
[object Object]

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

[object Object]