[object Object]

[object Object][object Object]undefined
[object Object]
  • API description: Performs backpropagation of to compute the gradients of tensors input and grid.

  • Formulas:

    • Computing process:

      1. The coordinates mapped to input are calculated based on the (x, y, z) values stored in grid. The coordinates are related to alignCorners and paddingMode.
      2. The coordinates are used to calculate the output value in bilinear or nearest interpolation mode based on the input interpolationMode.
      3. The final dx and dgrid results are calculated based on the gradient value stored in grad multiplied by the weight of the corresponding point.
    • The values are as follows:

      The dimensions of grad, input, grid, dx, and dgrid are as follows:

      grad:(N,C,Dout,Hout,Wout)input:(N,C,Din,Hin,Win)grid:(N,Dout,Hout,Wout,3)dx:(N,C,Din,Hin,Win)dgrid:(N,Dout,Hout,Wout,3)grad: (N, C, D_{out}, H_{out}, W_{out})\\ input: (N, C, D_{in}, H_{in}, W_{in})\\ grid: (N, D_{out}, H_{out}, W_{out}, 3)\\ dx: (N, C, D_{in}, H_{in}, W_{in})\\ dgrid: (N, D_{out}, H_{out}, W_{out}, 3)

      grad, input, grid, dx, and dgrid have the same N. grad, input, and dx have the same C. DinD_{in}, HinH_{in}, and WinW_{in} in input and dx are the same. DoutD_{out}, HoutH_{out}, and WoutW_{out} in grad, grid, and dgrid are the same. The size of the last dimension of grid is 3, indicating that the input pixel location is (x, y, z). The value ranges of x, y, and z are normalized to [-1, 1].

      • Out-of-bound coordinates are processed based on the padding mode.

        • paddingMode="zeros": Use 0 for out-of-bound locations.
        • paddingMode="border": Use border values for out-of-bound locations.
        • paddingMode="reflection": Use symmetric values of the border values for out-of-bound locations.
      • During input sampling, the processing varies according to interpolationMode.

        • interpolationMode="bilinear": Use the weighted average value of the 8 coordinates around (x, y, z) in the input.
        • interpolationMode="nearest": Use the nearest coordinates to (x, y, z) in the input.
[object Object]

Each operator has calls. First, aclnnGridSampler3DBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnGridSampler3DBackward is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
    • [object Object]Atlas training products[object Object]:

      The data types of gradOutput, input, grid, inputGrad, and gridGrad do not support BFLOAT16.

  • 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:
    • aclnnGridSampler3DBackward defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic computing.
[object Object]

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

[object Object]