sparse_bw_api.yaml 3.4 KB
Newer Older
1
- backward_api : conv3d_grad
Z
zhangkaihuo 已提交
2 3
  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)
4
  output : Tensor(x_grad), Tensor(kernel_grad)
5
  kernel :
6
    func : sparse_conv3d_grad{sparse_coo, dense, dense, sparse_coo -> sparse_coo, dense}
Z
zhangkaihuo 已提交
7

8
- backward_api : coo_to_dense_grad
9
  forward : coo_to_dense(Tensor x) -> Tensor(out)
10
  args : (Tensor x, Tensor out_grad)
11
  output : Tensor(x_grad)
12
  kernel :
13
    func : sparse_coo_to_dense_grad{sparse_coo, dense-> sparse_coo}
14

15
- backward_api : create_sparse_coo_tensor_grad
16
  forward : create_sparse_coo_tensor(Tensor values, Tensor indices, IntArray dense_shape) -> Tensor(out)
17
  args : (Tensor indices, Tensor out_grad)
18
  output : Tensor(values_grad)
19
  kernel :
20
    func : sparse_coo_tensor_grad{dense, sparse_coo -> dense}
21

22
- backward_api : dense_to_coo_grad
23
  forward : dense_to_coo(Tensor x, int64_t sparse_dim) -> Tensor(out)
24
  args : (Tensor out_grad)
25
  output : Tensor(x_grad)
26 27
  invoke : to_dense_impl(out_grad)

28 29 30 31 32 33 34 35 36 37 38 39 40 41
- 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}

42 43
- backward_api : relu_grad
  forward : relu(Tensor x) -> Tensor(out)
44
  args : (Tensor out, Tensor out_grad)
45
  output : Tensor(x_grad)
Z
zhangkaihuo 已提交
46
  kernel :
47
    func : sparse_coo_relu_grad {sparse_coo, sparse_coo -> sparse_coo}
Z
zhangkaihuo 已提交
48

49 50
- backward_api : sin_grad
  forward : sin(Tensor x) -> Tensor(out)
Z
zhangkaihuo 已提交
51
  args : (Tensor x, Tensor out_grad)
52 53 54 55
  output : Tensor(x_grad)
  kernel :
    func : sparse_coo_sin_grad {sparse_coo, sparse_coo -> sparse_coo}

56 57 58 59 60 61 62
- 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}

63 64 65 66
- 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 已提交
67
  kernel :
68
    func : sparse_maxpool_grad {sparse_coo, dense, sparse_coo, sparse_coo -> sparse_coo}
69

70 71
- backward_api : sqrt_grad
  forward : sqrt(Tensor x) -> Tensor(out)
72
  args : (Tensor out, Tensor out_grad)
73
  output : Tensor(x_grad)
74
  kernel :
75
    func : sparse_coo_sqrt_grad {sparse_coo, sparse_coo -> sparse_coo}
76

77 78
- backward_api : tanh_grad
  forward : tanh(Tensor x) -> Tensor(out)
79
  args : (Tensor out, Tensor out_grad)
80
  output : Tensor(x_grad)
81
  kernel :
82
    func : sparse_coo_tanh_grad {sparse_coo, sparse_coo -> sparse_coo}
83

84 85 86 87
- backward_api : values_grad
  forward : coo_values(Tensor x) -> Tensor(out)
  args : (Tensor x, Tensor out_grad)
  output : Tensor(x_grad)
88
  kernel :
89
    func : coo_values_grad{sparse_coo, dense-> sparse_coo}