sparse_bw_api.yaml 5.2 KB
Newer Older
1 2 3 4 5 6 7 8
- backward_api : add_grad
  forward : add(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  kernel :
    func : add_coo_coo_grad{sparse_coo, sparse_coo, sparse_coo -> sparse_coo, sparse_coo},
           add_csr_csr_grad{sparse_csr, sparse_csr, sparse_csr -> sparse_csr, sparse_csr}

9
- backward_api : conv3d_grad
Z
zhangkaihuo 已提交
10 11
  forward : conv3d (Tensor x, Tensor kernel, int[] paddings, int[] dilations, int[] strides, int groups, bool subm) -> Tensor(out@SparseCooTensor), Tensor(rulebook@DenseTensor)
  args : (Tensor x, Tensor kernel, Tensor rulebook, Tensor out_grad, int[] paddings, int[] dilations, int[] strides, int groups, bool subm)
12
  output : Tensor(x_grad), Tensor(kernel_grad)
13
  kernel :
14
    func : sparse_conv3d_grad{sparse_coo, dense, dense, sparse_coo -> sparse_coo, dense}
Z
zhangkaihuo 已提交
15

16
- backward_api : coo_to_dense_grad
17
  forward : coo_to_dense(Tensor x) -> Tensor(out)
18
  args : (Tensor x, Tensor out_grad)
19
  output : Tensor(x_grad)
20
  kernel :
21
    func : sparse_coo_to_dense_grad{sparse_coo, dense-> sparse_coo}
22

23
- backward_api : create_sparse_coo_tensor_grad
24
  forward : create_sparse_coo_tensor(Tensor values, Tensor indices, IntArray dense_shape) -> Tensor(out)
25
  args : (Tensor indices, Tensor out_grad)
26
  output : Tensor(values_grad)
27
  kernel :
28
    func : sparse_coo_tensor_grad{dense, sparse_coo -> dense}
29

30
- backward_api : dense_to_coo_grad
31
  forward : dense_to_coo(Tensor x, int64_t sparse_dim) -> Tensor(out)
32
  args : (Tensor out_grad)
33
  output : Tensor(x_grad)
34 35
  invoke : to_dense_impl(out_grad)

36 37 38 39 40 41 42 43
- backward_api : divide_grad
  forward : divide(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  kernel :
    func : divide_coo_coo_grad{sparse_coo, sparse_coo, sparse_coo, sparse_coo -> sparse_coo, sparse_coo},
           divide_csr_csr_grad{sparse_csr, sparse_csr, sparse_csr, sparse_csr -> sparse_csr, sparse_csr}

44 45 46 47 48 49 50 51 52 53 54 55 56 57
- backward_api : masked_matmul_grad
  forward : masked_matmul(Tensor x, Tensor y, Tensor mask) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  kernel :
    func : csr_masked_matmul_grad{dense, dense, sparse_csr -> dense, dense}

- backward_api : matmul_grad
  forward : matmul(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  kernel :
    func : csr_dense_matmul_grad{sparse_csr, dense, dense -> sparse_csr, dense}

58 59 60 61 62 63 64 65
- backward_api : multiply_grad
  forward : multiply(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  kernel :
    func : multiply_coo_coo_grad{sparse_coo, sparse_coo, sparse_coo -> sparse_coo, sparse_coo},
           multiply_csr_csr_grad{sparse_csr, sparse_csr, sparse_csr -> sparse_csr, sparse_csr}

66 67 68 69 70 71 72 73
- backward_api : mv_grad
  forward : mv(Tensor x, Tensor vec) -> Tensor(out)
  args : (Tensor x, Tensor vec, Tensor out_grad)
  output : Tensor(x_grad), Tensor(vec_grad)
  kernel :
    func : mv_coo_grad{sparse_coo, dense, dense -> sparse_coo, dense},
           mv_csr_grad{sparse_csr, dense, dense -> sparse_csr, dense}

74 75
- backward_api : relu_grad
  forward : relu(Tensor x) -> Tensor(out)
76
  args : (Tensor out, Tensor out_grad)
77
  output : Tensor(x_grad)
Z
zhangkaihuo 已提交
78
  kernel :
79
    func : sparse_coo_relu_grad {sparse_coo, sparse_coo -> sparse_coo}
Z
zhangkaihuo 已提交
80

81 82
- backward_api : sin_grad
  forward : sin(Tensor x) -> Tensor(out)
Z
zhangkaihuo 已提交
83
  args : (Tensor x, Tensor out_grad)
84 85 86 87
  output : Tensor(x_grad)
  kernel :
    func : sparse_coo_sin_grad {sparse_coo, sparse_coo -> sparse_coo}

88 89 90 91 92 93 94
- backward_api : softmax_grad
  forward : softmax(Tensor x, int axis=-1) -> Tensor(out)
  args : (Tensor out, Tensor out_grad, int axis)
  output : Tensor(x_grad)
  kernel :
    func : softmax_csr_grad{sparse_csr, sparse_csr -> sparse_csr}

95 96 97 98
- backward_api : sparse_maxpool_grad
  forward : sparse_maxpool(Tensor x, int[] kernel_sizes, int[] paddings, int[] dilations, int[] strides) -> Tensor(out), Tensor(rulebook)
  args : (Tensor x, Tensor rulebook, Tensor out, Tensor out_grad, int[] kernel_sizes)
  output : Tensor(x_grad)
Z
zyfncg 已提交
99
  kernel :
100
    func : sparse_maxpool_grad {sparse_coo, dense, sparse_coo, sparse_coo -> sparse_coo}
101

102 103
- backward_api : sqrt_grad
  forward : sqrt(Tensor x) -> Tensor(out)
104
  args : (Tensor out, Tensor out_grad)
105
  output : Tensor(x_grad)
106
  kernel :
107
    func : sparse_coo_sqrt_grad {sparse_coo, sparse_coo -> sparse_coo}
108

109 110 111 112 113 114 115 116
- backward_api : subtract_grad
  forward : subtract(Tensor x, Tensor y) -> Tensor(out)
  args : (Tensor x, Tensor y, Tensor out_grad)
  output : Tensor(x_grad), Tensor(y_grad)
  kernel :
    func : subtract_coo_coo_grad{sparse_coo, sparse_coo, sparse_coo -> sparse_coo, sparse_coo},
           subtract_csr_csr_grad{sparse_csr, sparse_csr, sparse_csr -> sparse_csr, sparse_csr}

117 118
- backward_api : tanh_grad
  forward : tanh(Tensor x) -> Tensor(out)
119
  args : (Tensor out, Tensor out_grad)
120
  output : Tensor(x_grad)
121
  kernel :
122
    func : sparse_coo_tanh_grad {sparse_coo, sparse_coo -> sparse_coo}
123

124 125 126 127
- backward_api : values_grad
  forward : coo_values(Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
128
  kernel :
129
    func : coo_values_grad{sparse_coo, dense-> sparse_coo}