api.yaml 4.5 KB
Newer Older
1 2 3
- api : add
  args : (const Tensor& x, const Tensor& y)
  output : Tensor
4
  infer_meta :
5
    func : ElementwiseInferMeta
6
    param : [x, y]
7
  kernel :
Y
YuanRisheng 已提交
8
    func : add
9 10 11 12

- api : cast
  args : (const Tensor& x, DataType out_dtype)
  output : Tensor
13
  infer_meta :
14 15 16
    func : CastInferMeta
  kernel :
    func : cast
17
    param : [x, out_dtype]
18 19
    data_type : x

20 21 22 23 24 25

- api : concat
  args : (const std::vector<Tensor>& x, const Scalar& axis)
  output : Tensor
  infer_meta :
    func : ConcatInferMeta
26
    param : [x, axis]
27 28 29
  kernel :
    func : concat

30 31 32 33 34 35 36 37
- api : conj
  args : (const Tensor& x)
  output : Tensor
  infer_meta :
    func : UnchangedInferMeta
  kernel :
    func : conj

38 39 40
- api : divide
  args : (const Tensor& x, const Tensor& y)
  output : Tensor
41
  infer_meta :
42
    func : ElementwiseInferMeta
43
    param : [x, y]
44
  kernel :
Y
YuanRisheng 已提交
45
    func : divide
46 47 48 49

- api : dot
  args : (const Tensor& x, const Tensor& y)
  output : Tensor
50
  infer_meta :
51
    func : DotInferMeta
52
  kernel :
53 54
    func : dot

55 56 57
- api : empty
  args : (const ScalarArray& shape, DataType dtype=DataType::FLOAT32, Backend place=Backend::CPU, DataLayout layout=DataLayout::NCHW)
  output: Tensor
58
  infer_meta :
59 60
    func : CreateInferMeta
    param : [shape, dtype, layout]
61
  kernel :
62 63 64 65 66
    func : empty
    param : [shape]
    data_type : dtype
    backend : place
    layout : layout
67

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

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

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

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

- api : matmul
  args : (const Tensor& x, const Tensor& y, bool transpose_x = false, bool transpose_y = false)
  output : Tensor
118
  infer_meta :
119
    func : MatmulInferMeta
120
  kernel :
121
    func : matmul
122
  backward : matmul_grad
123 124

- api : mean
125
  args : (const Tensor& x, const std::vector<int64_t>& axis={}, bool keep_dim=false)
126
  output : Tensor
127
  infer_meta :
128
    func : ReduceInferMeta
129
    param: [x, axis, keep_dim]
130
  kernel :
Y
YuanRisheng 已提交
131
    func : mean
132 133 134 135

- api : multiply
  args : (const Tensor& x, const Tensor& y)
  output : Tensor
136
  infer_meta :
137
    func : ElementwiseInferMeta
138
    param : [x, y]
139
  kernel :
Y
YuanRisheng 已提交
140
    func : multiply
141 142 143 144 145 146 147

- api : ones_like
  args : (const Tensor& x, DataType dtype=DataType::UNDEFINED, Backend place=Backend::UNDEFINED, DataLayout layout=DataLayout::UNDEFINED)
  output : Tensor
  invoke : full_like(x, 1, dtype, place, layout)

- api : reshape
148
  args : (const Tensor& x, const ScalarArray& shape)
149
  output : Tensor
150
  infer_meta :
151
    func : ReshapeInferMeta
152
  kernel :
Y
YuanRisheng 已提交
153
    func : reshape
154 155 156 157

- api : scale
  args : (const Tensor& x, const Scalar& scale, float bias, bool bias_after_scale)
  output : Tensor
158
  infer_meta :
159 160 161 162 163 164 165 166
    func : UnchangedInferMeta
    param : [x]
  kernel :
    func : scale

- api : subtract
  args : (const Tensor& x, const Tensor& y)
  output : Tensor
167
  infer_meta :
168
    func : ElementwiseInferMeta
169
    param : [x, y]
170
  kernel :
Y
YuanRisheng 已提交
171
    func : subtract
172 173

- api : sum
174
  args : (const Tensor& x, const std::vector<int64_t>& axis={}, DataType dtype=DataType::UNDEFINED, bool keep_dim=false)
175
  output : Tensor
176 177 178 179
  infer_meta : 
    func : SumInferMeta
    param: [x, axis, dtype, keep_dim]
  kernel : 
Y
YuanRisheng 已提交
180
    func : sum
181
    param : [x, axis, dtype, keep_dim]
182
    data_type : x
183 184 185 186 187

- api : zeros_like
  args : (const Tensor& x, DataType dtype=DataType::UNDEFINED, Backend place=Backend::UNDEFINED, DataLayout layout=DataLayout::UNDEFINED)
  output : Tensor
  invoke : full_like(x, 0, dtype, place, layout)