api.yaml 5.3 KB
Newer Older
1
- api : add
Z
zyfncg 已提交
2
  args : (Tensor x, Tensor y)
3
  output : Tensor
4
  infer_meta :
5 6
    func : ElementwiseInferMeta
  kernel :
Y
YuanRisheng 已提交
7
    func : add
8 9

- api : cast
Z
zyfncg 已提交
10
  args : (Tensor x, DataType out_dtype)
11
  output : Tensor
12
  infer_meta :
13 14 15
    func : CastInferMeta
  kernel :
    func : cast
16
    param : [x, out_dtype]
17 18
    data_type : x

19 20

- api : concat
Z
zyfncg 已提交
21
  args : (Tensor[] x, Scalar axis)
22 23 24
  output : Tensor
  infer_meta :
    func : ConcatInferMeta
25
    param : [x, axis]
26 27 28
  kernel :
    func : concat

29
- api : conj
Z
zyfncg 已提交
30
  args : (Tensor x)
31 32 33 34 35 36
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : conj

37 38 39 40 41
- api : copy_to
  args : (Tensor x, Backend backend, bool blocking)
  output : Tensor
  invoke : copy_to_impl(x, backend, blocking)

42
- api : divide
Z
zyfncg 已提交
43
  args : (Tensor x, Tensor y)
44
  output : Tensor
45
  infer_meta :
46 47
    func : ElementwiseInferMeta
  kernel :
Y
YuanRisheng 已提交
48
    func : divide
49 50

- api : dot
Z
zyfncg 已提交
51
  args : (Tensor x, Tensor y)
52
  output : Tensor
53
  infer_meta :
54
    func : DotInferMeta
55
  kernel :
56 57
    func : dot

58
- api : empty
59
  args : (ScalarArray shape, DataType dtype=DataType::FLOAT32, Backend place=Backend::CPU)
60
  output: Tensor
61
  infer_meta :
62
    func : CreateInferMeta
63
    param : [shape, dtype]
64
  kernel :
65
    func : empty
66
    param : [shape, dtype]
67 68
    data_type : dtype
    backend : place
69

70
- api : empty_like
71
  args : (Tensor x, DataType dtype = DataType::UNDEFINED, Backend place = Backend::UNDEFINED)
72
  output: Tensor
73
  infer_meta :
74
    func : CreateLikeInferMeta
75
    param : [x, dtype]
76
  kernel :
77
    func : empty_like
78
    param : [x, dtype]
79 80 81
    data_type : dtype > x
    backend : place > x

82
- api : flatten
Z
zyfncg 已提交
83
  args : (Tensor x, int start_axis, int stop_axis)
84
  output : Tensor
85
  infer_meta :
86
    func : FlattenInferMeta
87
  kernel :
Y
YuanRisheng 已提交
88
    func : flatten
89 90

- api : full
91
  args : (ScalarArray shape, Scalar value, DataType dtype=DataType::FLOAT32, Backend place=Backend::CPU)
92
  output: Tensor
93
  infer_meta :
Z
zyfncg 已提交
94
    func : CreateInferMeta
95
    param : [shape, dtype]
96
  kernel :
Y
YuanRisheng 已提交
97
    func : full
98
    param : [shape, value, dtype]
99 100
    data_type : dtype
    backend : place
101

102
- api : full_like
103
  args : (Tensor x, Scalar value, DataType dtype = DataType::UNDEFINED, Backend place = Backend::UNDEFINED)
104
  output: Tensor
105
  infer_meta :
Z
zyfncg 已提交
106
    func : CreateLikeInferMeta
107
    param : [x, dtype]
108
  kernel :
Y
YuanRisheng 已提交
109
    func : full_like
110
    param : [x, value, dtype]
111 112 113 114
    data_type : dtype > x
    backend : place > x

- api : matmul
Z
zyfncg 已提交
115
  args : (Tensor x, Tensor y, bool transpose_x = false, bool transpose_y = false)
116
  output : Tensor
117
  infer_meta :
118
    func : MatmulInferMeta
119
  kernel :
120
    func : matmul
121
  backward : matmul_grad
122 123

- api : mean
124
  args : (Tensor x, int64[] axis={}, bool keep_dim=false)
125
  output : Tensor
126
  infer_meta :
127
    func : ReduceInferMeta
128
  kernel :
Y
YuanRisheng 已提交
129
    func : mean
130 131

- api : multiply
Z
zyfncg 已提交
132
  args : (Tensor x, Tensor y)
133
  output : Tensor
134
  infer_meta :
135 136
    func : ElementwiseInferMeta
  kernel :
Y
YuanRisheng 已提交
137
    func : multiply
138 139

- api : ones_like
140
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Backend place=Backend::UNDEFINED)
141
  output : Tensor
142
  invoke : full_like(x, 1, dtype, place)
143 144

- api : reshape
Z
zyfncg 已提交
145
  args : (Tensor x, ScalarArray shape)
146
  output : Tensor(out)
147
  infer_meta :
148
    func : ReshapeInferMeta
149
  kernel :
Y
YuanRisheng 已提交
150
    func : reshape
151
  inplace : (x -> out)
152

Y
YuanRisheng 已提交
153 154 155 156 157 158 159 160 161
- api : relu
  args : (Tensor x)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : relu
  inplace : (x -> out)

162
- api : scale
Z
zyfncg 已提交
163
  args : (Tensor x, Scalar scale, float bias, bool bias_after_scale)
164
  output : Tensor
165
  infer_meta :
166 167 168
    func : UnchangedInferMeta
    param : [x]
  kernel :
169
    func : scale, scale_sr
170
  inplace : (x -> out)
171

172
- api : sign
Z
zyfncg 已提交
173
  args : (Tensor x)
174 175 176 177 178 179
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : sign

180 181 182 183 184
- api : split
  args : (Tensor x, ScalarArray num_or_sections, Scalar axis)
  output : Tensor[]
  invoke : split_impl(x, num_or_sections, axis)

185
- api : subtract
Z
zyfncg 已提交
186
  args : (Tensor x, Tensor y)
187
  output : Tensor
188
  infer_meta :
189 190
    func : ElementwiseInferMeta
  kernel :
Y
YuanRisheng 已提交
191
    func : subtract
192 193

- api : sum
194
  args : (Tensor x, int64[] axis={}, DataType dtype=DataType::UNDEFINED, bool keep_dim=false)
195
  output : Tensor
196
  infer_meta :
197
    func : SumInferMeta
198
  kernel :
Y
YuanRisheng 已提交
199
    func : sum
200
    data_type : x
201 202

- api : zeros_like
203
  args : (Tensor x, DataType dtype=DataType::UNDEFINED, Backend place=Backend::UNDEFINED)
204
  output : Tensor
205
  invoke : full_like(x, 0, dtype, place)
H
hong 已提交
206

H
hong 已提交
207 208 209 210 211 212 213 214 215

- api : one_hot
  args : (Tensor x, Scalar num_classes)
  output : Tensor
  infer_meta :
    func : OneHotInferMeta
  kernel :
    func : one_hot
    
H
hong 已提交
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
- api : digamma
  args : (Tensor x)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : digamma
  backward : digamma_grad

- api : abs
  args : (Tensor x)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : abs
  backward : abs_grad

- api : trunc
  args : (Tensor x)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : trunc
  backward : trunc_grad

# - api : norm
#   args : (Tensor x, int axis, float epsilon, bool is_test)
#   output : Tensor(out), Tensor(norm)
#   infer_meta :
#     func : NormInferMeta
#   kernel :
#     func : norm
#   intermediate : norm
#   backward : norm_grad

- api : diagonal
  args : (Tensor x, int offset, int axis1, int axis2)
  output : Tensor
  infer_meta :
    func : DiagonalInferMeta
  kernel :
    func : diagonal
  backward : diagonal_grad