Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
6891a4fe
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6891a4fe
编写于
9月 14, 2022
作者:
C
Chen Weihang
提交者:
GitHub
9月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
normize yaml backward op label (#46028)
上级
6bd2762c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
322 addition
and
323 deletion
+322
-323
paddle/fluid/eager/auto_code_generator/generator/codegen_utils.py
...luid/eager/auto_code_generator/generator/codegen_utils.py
+4
-4
paddle/fluid/eager/auto_code_generator/generator/eager_gen.py
...le/fluid/eager/auto_code_generator/generator/eager_gen.py
+2
-3
paddle/phi/api/yaml/backward.yaml
paddle/phi/api/yaml/backward.yaml
+21
-21
paddle/phi/api/yaml/generator/backward_api_gen.py
paddle/phi/api/yaml/generator/backward_api_gen.py
+1
-1
paddle/phi/api/yaml/generator/parse_api.py
paddle/phi/api/yaml/generator/parse_api.py
+1
-1
paddle/phi/api/yaml/generator/parse_utils.py
paddle/phi/api/yaml/generator/parse_utils.py
+1
-1
paddle/phi/api/yaml/legacy_backward.yaml
paddle/phi/api/yaml/legacy_backward.yaml
+254
-254
paddle/phi/api/yaml/sparse_backward.yaml
paddle/phi/api/yaml/sparse_backward.yaml
+38
-38
未找到文件。
paddle/fluid/eager/auto_code_generator/generator/codegen_utils.py
浏览文件 @
6891a4fe
...
...
@@ -83,10 +83,10 @@ def ReadBwdFile(filepath):
ret
=
{}
if
contents
is
not
None
:
for
content
in
contents
:
assert
'backward_
api
'
in
content
.
keys
(),
AssertMessage
(
'backward_
api
'
,
content
.
keys
())
if
'backward_
api
'
in
content
.
keys
():
api_name
=
content
[
'backward_
api
'
]
assert
'backward_
op
'
in
content
.
keys
(),
AssertMessage
(
'backward_
op
'
,
content
.
keys
())
if
'backward_
op
'
in
content
.
keys
():
api_name
=
content
[
'backward_
op
'
]
ret
[
api_name
]
=
content
f
.
close
()
...
...
paddle/fluid/eager/auto_code_generator/generator/eager_gen.py
浏览文件 @
6891a4fe
...
...
@@ -1485,7 +1485,7 @@ class DygraphNodeGenerator(DygraphFunctionGeneratorBase):
if
next_grad_api_contents
:
# Fake forward_api_contents and backward_api_contents
forward_api_contents
=
grad_api_contents
forward_api_contents
[
'op'
]
=
forward_api_contents
[
'backward_
api
'
]
forward_api_contents
[
'op'
]
=
forward_api_contents
[
'backward_
op
'
]
backward_api_contents
=
next_grad_api_contents
next_node_generator
=
DygraphFunctionGeneratorBase
(
...
...
@@ -1959,8 +1959,7 @@ class DygraphForwardAndNodesGenerator(GeneratorBase):
forward_api_contents
=
backward_api_contents
# Fake forward_api_content
forward_api_contents
[
'op'
]
=
forward_api_contents
[
'backward_api'
]
forward_api_contents
[
'op'
]
=
forward_api_contents
[
'backward_op'
]
backward_api_contents
=
next_grad_api_contents
if
len
(
namespace
)
>
0
:
...
...
paddle/phi/api/yaml/backward.yaml
浏览文件 @
6891a4fe
-
backward_
api
:
atan2_grad
-
backward_
op
:
atan2_grad
forward
:
atan2 (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -8,7 +8,7 @@
kernel
:
func
:
atan2_grad
-
backward_
api
:
cholesky_grad
-
backward_
op
:
cholesky_grad
forward
:
cholesky (Tensor x, bool upper) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, bool upper)
output
:
Tensor(x_grad)
...
...
@@ -18,7 +18,7 @@
kernel
:
func
:
cholesky_grad
-
backward_
api
:
cholesky_solve_grad
-
backward_
op
:
cholesky_solve_grad
forward
:
cholesky_solve (Tensor x, Tensor y, bool upper) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out, Tensor out_grad, bool upper)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -28,7 +28,7 @@
kernel
:
func
:
cholesky_solve_grad
-
backward_
api
:
cross_grad
-
backward_
op
:
cross_grad
forward
:
cross (Tensor x, Tensor y, int axis = 9) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -39,7 +39,7 @@
func
:
cross_grad
data_type
:
out_grad
-
backward_
api
:
diag_grad
-
backward_
op
:
diag_grad
forward
:
diag (Tensor x, int offset, float padding_value) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int offset)
output
:
Tensor(x_grad)
...
...
@@ -51,7 +51,7 @@
data_type
:
out_grad
no_need_buffer
:
x
-
backward_
api
:
diagonal_grad
-
backward_
op
:
diagonal_grad
forward
:
diagonal (Tensor x, int offset, int axis1, int axis2) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int offset = 0, int axis1 = 0, int axis2 = 1)
output
:
Tensor(x_grad)
...
...
@@ -63,7 +63,7 @@
data_type
:
out_grad
no_need_buffer
:
x
-
backward_
api
:
digamma_grad
-
backward_
op
:
digamma_grad
forward
:
digamma (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -73,7 +73,7 @@
kernel
:
func
:
digamma_grad
-
backward_
api
:
dist_grad
-
backward_
op
:
dist_grad
forward
:
dist (Tensor x, Tensor y, float p) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out, Tensor out_grad, float p)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -83,7 +83,7 @@
kernel
:
func
:
dist_grad
-
backward_
api
:
dot_grad
-
backward_
op
:
dot_grad
forward
:
dot (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -94,7 +94,7 @@
func
:
dot_grad
data_type
:
out_grad
-
backward_
api
:
erf_grad
-
backward_
op
:
erf_grad
forward
:
erf (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -105,7 +105,7 @@
func
:
erf_grad
data_type
:
out_grad
-
backward_
api
:
erfinv_grad
-
backward_
op
:
erfinv_grad
forward
:
erfinv (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -115,7 +115,7 @@
kernel
:
func
:
erfinv_grad
-
backward_
api
:
fft_c2c_grad
-
backward_
op
:
fft_c2c_grad
forward
:
fft_c2c(Tensor x, int64_t[] axes, str normalization, bool forward) -> Tensor(out)
args
:
(Tensor out_grad, int64_t[] axes, str normalization, bool forward)
output
:
Tensor(x_grad)
...
...
@@ -125,7 +125,7 @@
kernel
:
func
:
fft_c2c_grad
-
backward_
api
:
fft_c2r_grad
-
backward_
op
:
fft_c2r_grad
forward
:
fft_c2r(Tensor x, int64_t[] axes, str normalization, bool forward, int64_t last_dim_size) -> Tensor(out)
args
:
(Tensor out_grad, int64_t[] axes, str normalization, bool forward, int64_t last_dim_size)
output
:
Tensor(x_grad)
...
...
@@ -135,7 +135,7 @@
func
:
fft_c2r_grad
data_type
:
out_grad
-
backward_
api
:
fft_r2c_grad
-
backward_
op
:
fft_r2c_grad
forward
:
fft_r2c(Tensor x, int64_t[] axes, str normalization, bool forward, bool onesided) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int64_t[] axes, str normalization, bool forward, bool onesided)
output
:
Tensor(x_grad)
...
...
@@ -147,7 +147,7 @@
data_type
:
out_grad
no_need_buffer
:
x
-
backward_
api
:
graph_send_uv_grad
-
backward_
op
:
graph_send_uv_grad
forward
:
graph_send_uv (Tensor x, Tensor y, Tensor src_index, Tensor dst_index, str message_op = "ADD") -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor src_index, Tensor dst_index, Tensor out_grad, str message_op = "ADD")
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -158,7 +158,7 @@
func
:
graph_send_uv_grad
data_type
:
x
-
backward_
api
:
lgamma_grad
-
backward_
op
:
lgamma_grad
forward
:
lgamma(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -168,7 +168,7 @@
kernel
:
func
:
lgamma_grad
-
backward_
api
:
mv_grad
-
backward_
op
:
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)
...
...
@@ -178,7 +178,7 @@
kernel
:
func
:
mv_grad
-
backward_
api
:
poisson_grad
-
backward_
op
:
poisson_grad
forward
:
poisson (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -188,7 +188,7 @@
kernel
:
func
:
poisson_grad
-
backward_
api
:
solve_grad
-
backward_
op
:
solve_grad
forward
:
solve (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -198,7 +198,7 @@
kernel
:
func
:
solve_grad
-
backward_
api
:
trace_grad
-
backward_
op
:
trace_grad
forward
:
trace (Tensor x, int offset, int axis1, int axis2) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int offset, int axis1, int axis2)
output
:
Tensor(x_grad)
...
...
@@ -210,7 +210,7 @@
data_type
:
out_grad
no_need_buffer
:
x
-
backward_
api
:
trunc_grad
-
backward_
op
:
trunc_grad
forward
:
trunc (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
paddle/phi/api/yaml/generator/backward_api_gen.py
浏览文件 @
6891a4fe
...
...
@@ -28,7 +28,7 @@ class BackwardAPI(BaseAPI):
self
.
no_need_buffer
=
self
.
parse_no_need_buffer
(
backward_item_yaml
)
def
get_api_name
(
self
,
api_item_yaml
):
return
api_item_yaml
[
'backward_
api
'
]
return
api_item_yaml
[
'backward_
op
'
]
def
parse_forward_config
(
self
,
forward_config
):
# api_name (const Tensor& input, ... , int attr, ...) -> Tensor(out)
...
...
paddle/phi/api/yaml/generator/parse_api.py
浏览文件 @
6891a4fe
...
...
@@ -27,7 +27,7 @@ def main(api_yaml_path, output_path, backward):
apis
=
[]
else
:
apis
=
[
parse_api_entry
(
api
,
"backward_
api
"
if
backward
else
"op"
)
parse_api_entry
(
api
,
"backward_
op
"
if
backward
else
"op"
)
for
api
in
apis
]
...
...
paddle/phi/api/yaml/generator/parse_utils.py
浏览文件 @
6891a4fe
...
...
@@ -334,7 +334,7 @@ def parse_api_entry(api_entry: Dict[str, Any], name_field="op"):
api
[
"backward"
]
=
backward
# forward for backward_apis
is_backward_api
=
name_field
==
"backward_
api
"
is_backward_api
=
name_field
==
"backward_
op
"
if
is_backward_api
:
if
"forward"
in
api_entry
:
forward
=
parse_forward
(
api_name
,
api_entry
[
"forward"
])
...
...
paddle/phi/api/yaml/legacy_backward.yaml
浏览文件 @
6891a4fe
-
backward_
api
:
abs_double_grad
-
backward_
op
:
abs_double_grad
forward
:
abs_grad (Tensor x, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor x, Tensor grad_x_grad)
output
:
Tensor(grad_out_grad)
...
...
@@ -10,7 +10,7 @@
data_transform
:
skip_transform
:
grad_x_grad
-
backward_
api
:
abs_grad
-
backward_
op
:
abs_grad
forward
:
abs (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -23,7 +23,7 @@
skip_transform
:
out_grad
backward
:
abs_double_grad
-
backward_
api
:
acos_grad
-
backward_
op
:
acos_grad
forward
:
acos (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -34,7 +34,7 @@
func
:
acos_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
acosh_grad
-
backward_
op
:
acosh_grad
forward
:
acosh (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -45,7 +45,7 @@
func
:
acosh_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
add_double_grad
-
backward_
op
:
add_double_grad
forward
:
add_grad (Tensor x, Tensor y, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
args
:
(Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
output
:
Tensor(grad_out_grad)
...
...
@@ -58,7 +58,7 @@
backward
:
add_triple_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
add_grad
-
backward_
op
:
add_grad
forward
:
add (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis = -1)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -71,7 +71,7 @@
backward
:
add_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
add_triple_grad
-
backward_
op
:
add_triple_grad
forward
:
add_double_grad (Tensor y, Tensor grad_out, Tensor grad_grad_x, Tensor grad_grad_y, int axis = -1) -> Tensor(grad_grad_out)
args
:
(Tensor grad_grad_x, Tensor grad_grad_y, Tensor grad_grad_out_grad, int axis = -1)
output
:
Tensor(grad_grad_x_grad), Tensor(grad_grad_y_grad)
...
...
@@ -82,7 +82,7 @@
func
:
add_triple_grad
inplace
:
(grad_grad_out_grad -> grad_grad_x_grad)
-
backward_
api
:
addmm_grad
-
backward_
op
:
addmm_grad
forward
:
addmm (Tensor input, Tensor x, Tensor y, float alpha, float beta) -> Tensor(out)
args
:
(Tensor input, Tensor x, Tensor y, Tensor out_grad, float alpha, float beta)
output
:
Tensor(input_grad), Tensor(x_grad), Tensor(y_grad)
...
...
@@ -92,7 +92,7 @@
kernel
:
func
:
addmm_grad
-
backward_
api
:
affine_grid_grad
-
backward_
op
:
affine_grid_grad
forward
:
affine_grid (Tensor input, IntArray outputShape, bool use_cudnn=true, bool align_corners=true) -> Tensor(output)
args
:
(Tensor output_grad, IntArray outputShape, bool use_cudnn=true, bool align_corners=true)
output
:
Tensor(input_grad)
...
...
@@ -104,7 +104,7 @@
param
:
[
output_grad
,
outputShape
,
align_corners
]
use_gpudnn
:
use_cudnn
-
backward_
api
:
amax_grad
-
backward_
op
:
amax_grad
forward
:
amax (Tensor x, int64_t[] dims={}, bool keep_dim=false) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int64_t[] dims={}, bool keep_dim=false, bool reduce_all=false)
output
:
Tensor(x_grad)
...
...
@@ -114,7 +114,7 @@
kernel
:
func
:
amax_grad
-
backward_
api
:
amin_grad
-
backward_
op
:
amin_grad
forward
:
amin (Tensor x, int64_t[] dims={}, bool keep_dim=false) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int64_t[] dims={}, bool keep_dim=false, bool reduce_all=false)
output
:
Tensor(x_grad)
...
...
@@ -124,7 +124,7 @@
kernel
:
func
:
amin_grad
-
backward_
api
:
angle_grad
-
backward_
op
:
angle_grad
forward
:
angle (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -136,7 +136,7 @@
data_transform
:
skip_transform
:
out_grad
-
backward_
api
:
argsort_grad
-
backward_
op
:
argsort_grad
forward
:
argsort (Tensor x, int axis, bool descending) -> Tensor(out), Tensor(indices)
args
:
(Tensor indices, Tensor x, Tensor out_grad, int axis, bool descending)
output
:
Tensor(x_grad)
...
...
@@ -148,19 +148,19 @@
data_type
:
out_grad
no_need_buffer
:
x
-
backward_
api
:
as_complex_grad
-
backward_
op
:
as_complex_grad
forward
:
as_complex (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
invoke
:
as_real(out_grad)
-
backward_
api
:
as_real_grad
-
backward_
op
:
as_real_grad
forward
:
as_real (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
invoke
:
as_complex(out_grad)
-
backward_
api
:
asin_grad
-
backward_
op
:
asin_grad
forward
:
asin (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -171,7 +171,7 @@
func
:
asin_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
asinh_grad
-
backward_
op
:
asinh_grad
forward
:
asinh (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -182,13 +182,13 @@
func
:
asinh_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
assign_grad
-
backward_
op
:
assign_grad
forward
:
assign (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
invoke
:
assign(out_grad)
-
backward_
api
:
assign_out__grad
-
backward_
op
:
assign_out__grad
forward
:
assign_out_ (Tensor x, Tensor output) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -198,7 +198,7 @@
func
:
assign
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
atan_grad
-
backward_
op
:
atan_grad
forward
:
atan (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -209,7 +209,7 @@
func
:
atan_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
atanh_grad
-
backward_
op
:
atanh_grad
forward
:
atanh (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -220,7 +220,7 @@
func
:
atanh_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
batch_norm_double_grad
-
backward_
op
:
batch_norm_double_grad
forward
:
batch_norm_grad (Tensor x, Tensor scale, Tensor bias, Tensor out_mean, Tensor out_variance, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor grad_out, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) -> Tensor(grad_x), Tensor(grad_scale), Tensor(grad_bias)
args
:
(Tensor x, Tensor scale, Tensor out_mean, Tensor out_variance, Tensor saved_mean, Tensor saved_variance, Tensor grad_out, Tensor grad_x_grad, Tensor grad_scale_grad, Tensor grad_bias_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu)
output
:
Tensor(x_grad), Tensor(scale_grad), Tensor(grad_out_grad)
...
...
@@ -233,7 +233,7 @@
optional
:
out_mean, out_variance
inplace
:
(grad_out -> grad_out_grad)
-
backward_
api
:
batch_norm_grad
-
backward_
op
:
batch_norm_grad
forward
:
batch_norm (Tensor x, Tensor scale, Tensor bias, Tensor mean, Tensor variance, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
args
:
(Tensor x, Tensor scale, Tensor bias, Tensor mean_out, Tensor variance_out, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu)
output
:
Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
...
...
@@ -246,7 +246,7 @@
optional
:
mean_out, variance_out, reserve_space
backward
:
batch_norm_double_grad
-
backward_
api
:
bce_loss_grad
-
backward_
op
:
bce_loss_grad
forward
:
bce_loss (Tensor input, Tensor label) -> Tensor(out)
args
:
(Tensor input, Tensor label, Tensor out_grad)
output
:
Tensor(input_grad)
...
...
@@ -257,7 +257,7 @@
func
:
bce_loss_grad
inplace
:
(out_grad -> input_grad)
-
backward_
api
:
bicubic_interp_grad
-
backward_
op
:
bicubic_interp_grad
forward
:
bicubic_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
args
:
(Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
output
:
Tensor(x_grad)
...
...
@@ -269,7 +269,7 @@
func
:
bicubic_interp_grad
data_type
:
output_grad
-
backward_
api
:
bilinear_interp_grad
-
backward_
op
:
bilinear_interp_grad
forward
:
bilinear_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
args
:
(Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
output
:
Tensor(x_grad)
...
...
@@ -281,7 +281,7 @@
func
:
bilinear_interp_grad
data_type
:
output_grad
-
backward_
api
:
bilinear_tensor_product_grad
-
backward_
op
:
bilinear_tensor_product_grad
forward
:
bilinear_tensor_product (Tensor x, Tensor y, Tensor weight, Tensor bias) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor weight, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad), Tensor(weight_grad), Tensor(bias_grad)
...
...
@@ -290,7 +290,7 @@
kernel
:
func
:
bilinear_tensor_product_grad
-
backward_
api
:
bmm_grad
-
backward_
op
:
bmm_grad
forward
:
bmm (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -299,7 +299,7 @@
kernel
:
func
:
bmm_grad
-
backward_
api
:
brelu_grad
-
backward_
op
:
brelu_grad
forward
:
brelu (Tensor x, float t_min, float t_max) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float t_min, float t_max)
output
:
Tensor(x_grad)
...
...
@@ -310,7 +310,7 @@
func
:
brelu_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
broadcast_tensors_grad
-
backward_
op
:
broadcast_tensors_grad
forward
:
broadcast_tensors (Tensor[] x) -> Tensor[](out)
args
:
(Tensor[] x, Tensor[] out_grad)
output
:
Tensor[](x_grad)
...
...
@@ -322,7 +322,7 @@
param
:
[
out_grad
]
no_need_buffer
:
x
-
backward_
api
:
cast_grad
-
backward_
op
:
cast_grad
forward
:
cast (Tensor x, DataType out_dtype) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -334,7 +334,7 @@
data_type
:
out_grad
no_need_buffer
:
x
-
backward_
api
:
ceil_grad
-
backward_
op
:
ceil_grad
forward
:
ceil(Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -345,7 +345,7 @@
func
:
ceil_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
celu_double_grad
-
backward_
op
:
celu_double_grad
forward
:
celu_grad(Tensor x, Tensor grad_out, float alpha) -> Tensor(grad_x)
args
:
(Tensor x, Tensor grad_out, Tensor grad_x_grad, float alpha)
output
:
Tensor(x_grad), Tensor(grad_out_grad)
...
...
@@ -356,7 +356,7 @@
func
:
celu_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
celu_grad
-
backward_
op
:
celu_grad
forward
:
celu(Tensor x, float alpha) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float alpha)
output
:
Tensor(x_grad)
...
...
@@ -368,7 +368,7 @@
backward
:
celu_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
clip_double_grad
-
backward_
op
:
clip_double_grad
forward
:
clip_grad (Tensor x, Tensor grad_out, Scalar min = 0., Scalar max = 0.) -> Tensor(grad_x)
args
:
(Tensor x, Tensor grad_x_grad, Scalar min = 0., Scalar max = 0.)
output
:
Tensor(grad_out_grad)
...
...
@@ -378,7 +378,7 @@
kernel
:
func
:
clip_grad
-
backward_
api
:
clip_grad
-
backward_
op
:
clip_grad
forward
:
clip (Tensor x, Scalar min, Scalar max) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, Scalar min = 0., Scalar max = 0.)
output
:
Tensor(x_grad)
...
...
@@ -390,7 +390,7 @@
backward
:
clip_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
complex_grad
-
backward_
op
:
complex_grad
forward
:
complex (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -400,13 +400,13 @@
func
:
complex_grad
data_type
:
x
-
backward_
api
:
concat_double_grad
-
backward_
op
:
concat_double_grad
forward
:
concat_grad (Tensor[] x, Tensor grad_out, Scalar axis) -> Tensor[](grad_x)
args
:
(Tensor[] grad_x_grad, Scalar axis = 0)
output
:
Tensor(grad_out_grad)
invoke
:
concat(grad_x_grad, axis)
-
backward_
api
:
concat_grad
-
backward_
op
:
concat_grad
forward
:
concat (Tensor[] x, Scalar axis) -> Tensor(out)
args
:
(Tensor[] x, Tensor out_grad, Scalar axis = 0)
output
:
Tensor[](x_grad){x.size()}
...
...
@@ -418,7 +418,7 @@
no_need_buffer
:
x
backward
:
concat_double_grad
-
backward_
api
:
conj_grad
-
backward_
op
:
conj_grad
forward
:
conj (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -428,7 +428,7 @@
kernel
:
func
:
conj
-
backward_
api
:
conv2d_grad
-
backward_
op
:
conv2d_grad
forward
:
conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> Tensor(out)
args
:
(Tensor input, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
output
:
Tensor(input_grad), Tensor(filter_grad)
...
...
@@ -440,7 +440,7 @@
use_gpudnn
:
true
backward
:
conv2d_grad_grad
-
backward_
api
:
conv2d_grad_grad
-
backward_
op
:
conv2d_grad_grad
forward
:
conv2d_grad (Tensor input, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> Tensor(grad_input), Tensor(grad_filter)
args
:
(Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
output
:
Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
...
...
@@ -452,7 +452,7 @@
use_gpudnn
:
true
optional
:
grad_input_grad, grad_filter_grad
-
backward_
api
:
conv2d_transpose_double_grad
-
backward_
op
:
conv2d_transpose_double_grad
forward
:
conv2d_transpose_grad(Tensor x, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(grad_x), Tensor(grad_filter)
args
:
(Tensor x, Tensor filter, Tensor grad_out, Tensor grad_x_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
output
:
Tensor(x_grad), Tensor(filter_grad), Tensor(grad_out_grad)
...
...
@@ -462,7 +462,7 @@
func
:
conv2d_transpose_grad_grad
use_gpudnn
:
true
-
backward_
api
:
conv2d_transpose_grad
-
backward_
op
:
conv2d_transpose_grad
forward
:
conv2d_transpose(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
args
:
(Tensor x, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
output
:
Tensor(x_grad), Tensor(filter_grad)
...
...
@@ -473,7 +473,7 @@
use_gpudnn
:
true
backward
:
conv2d_transpose_double_grad
-
backward_
api
:
conv3d_grad
-
backward_
op
:
conv3d_grad
forward
:
conv3d (Tensor input, Tensor filter, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> Tensor(out)
args
:
(Tensor input, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
output
:
Tensor(input_grad), Tensor(filter_grad)
...
...
@@ -485,7 +485,7 @@
use_gpudnn
:
true
backward
:
conv3d_grad_grad
-
backward_
api
:
conv3d_grad_grad
-
backward_
op
:
conv3d_grad_grad
forward
:
conv3d_grad (Tensor input, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search) -> Tensor(grad_input), Tensor(grad_filter)
args
:
(Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search)
output
:
Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
...
...
@@ -497,7 +497,7 @@
use_gpudnn
:
true
optional
:
grad_input_grad, grad_filter_grad
-
backward_
api
:
conv3d_transpose_grad
-
backward_
op
:
conv3d_transpose_grad
forward
:
conv3d_transpose(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
args
:
(Tensor x, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
output
:
Tensor(x_grad), Tensor(filter_grad)
...
...
@@ -507,7 +507,7 @@
func
:
conv3d_transpose_grad
use_gpudnn
:
true
-
backward_
api
:
cos_grad
-
backward_
op
:
cos_grad
forward
:
cos (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -518,7 +518,7 @@
func
:
cos_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
cosh_grad
-
backward_
op
:
cosh_grad
forward
:
cosh (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -529,7 +529,7 @@
func
:
cosh_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
crop_tensor_grad
-
backward_
op
:
crop_tensor_grad
forward
:
crop_tensor (Tensor x, IntArray shape, IntArray offsets) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, IntArray offsets)
output
:
Tensor(x_grad)
...
...
@@ -539,7 +539,7 @@
func
:
crop_tensor_grad
data_type
:
x
-
backward_
api
:
cross_entropy_with_softmax_grad
-
backward_
op
:
cross_entropy_with_softmax_grad
forward
:
cross_entropy_with_softmax (Tensor input, Tensor label, bool soft_label, bool use_softmax, bool numeric_stable_mode, int ignore_index, int axis) -> Tensor(softmax), Tensor(loss)
args
:
(Tensor label, Tensor softmax, Tensor loss_grad, bool soft_label, bool use_softmax, bool numeric_stable_mode, int ignore_index, int axis)
output
:
Tensor(input_grad)
...
...
@@ -550,7 +550,7 @@
data_type
:
softmax
inplace
:
(softmax -> input_grad)
-
backward_
api
:
cumprod_grad
-
backward_
op
:
cumprod_grad
forward
:
cumprod (Tensor x, int dim) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int dim)
output
:
Tensor(x_grad)
...
...
@@ -560,13 +560,13 @@
kernel
:
func
:
cumprod_grad
-
backward_
api
:
cumsum_grad
-
backward_
op
:
cumsum_grad
forward
:
cumsum(Tensor x, Scalar axis, bool flatten, bool exclusive, bool reverse) -> Tensor(out)
args
:
(Tensor out_grad, Scalar axis, bool flatten, bool exclusive, bool reverse)
output
:
Tensor(x_grad)
invoke
:
cumsum(out_grad, axis, flatten, exclusive, !reverse)
-
backward_
api
:
deformable_conv_grad
-
backward_
op
:
deformable_conv_grad
forward
:
deformable_conv(Tensor x, Tensor offset, Tensor filter, Tensor mask, int[] strides, int[] paddings, int[] dilations, int deformable_groups, int groups, int im2col_step) -> Tensor(out)
args
:
(Tensor x, Tensor offset, Tensor filter, Tensor mask, Tensor out_grad, int[] strides, int[] paddings, int[] dilations, int deformable_groups, int groups, int im2col_step)
output
:
Tensor(x_grad), Tensor(offset_grad), Tensor(filter_grad), Tensor(mask_grad)
...
...
@@ -577,7 +577,7 @@
data_type
:
x
optional
:
mask
-
backward_
api
:
depthwise_conv2d_grad
-
backward_
op
:
depthwise_conv2d_grad
forward
:
depthwise_conv2d (Tensor input, Tensor filter, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu, bool use_gpudnn) -> Tensor(out)
args
:
(Tensor input, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu, bool use_gpudnn)
output
:
Tensor(input_grad), Tensor(filter_grad)
...
...
@@ -590,7 +590,7 @@
use_gpudnn
:
use_gpudnn
backward
:
depthwise_conv2d_grad_grad
-
backward_
api
:
depthwise_conv2d_grad_grad
-
backward_
op
:
depthwise_conv2d_grad_grad
forward
:
depthwise_conv2d_grad (Tensor input, Tensor filter, Tensor grad_out, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu, bool use_gpudnn) -> Tensor(grad_input), Tensor(grad_filter)
args
:
(Tensor input, Tensor filter, Tensor grad_out, Tensor grad_input_grad, Tensor grad_filter_grad, int[] strides, int[] paddings, str paddding_algorithm, int groups, int[] dilations, str data_format, bool use_addto, int workspace_size_MB, bool exhaustive_search, bool fuse_relu)
output
:
Tensor(input_grad), Tensor(filter_grad), Tensor(grad_out_grad)
...
...
@@ -601,7 +601,7 @@
func
:
depthwise_conv2d_grad_grad
optional
:
grad_input_grad, grad_filter_grad
-
backward_
api
:
depthwise_conv2d_transpose_grad
-
backward_
op
:
depthwise_conv2d_transpose_grad
forward
:
depthwise_conv2d_transpose(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
args
:
(Tensor x, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, int[] output_padding, IntArray output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
output
:
Tensor(x_grad), Tensor(filter_grad)
...
...
@@ -610,7 +610,7 @@
kernel
:
func
:
depthwise_conv2d_transpose_grad
-
backward_
api
:
det_grad
-
backward_
op
:
det_grad
forward
:
det (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -620,7 +620,7 @@
kernel
:
func
:
determinant_grad
-
backward_
api
:
divide_double_grad
-
backward_
op
:
divide_double_grad
forward
:
divide_grad (Tensor x, Tensor y, Tensor out, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
args
:
(Tensor y, Tensor out, Tensor grad_x, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
output
:
Tensor(y_grad), Tensor(out_grad), Tensor(grad_out_grad)
...
...
@@ -633,7 +633,7 @@
optional
:
grad_x_grad, grad_y_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
divide_grad
-
backward_
op
:
divide_grad
forward
:
divide (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out, Tensor out_grad, int axis = -1)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -644,7 +644,7 @@
func
:
divide_grad
backward
:
divide_double_grad
-
backward_
api
:
dropout_grad
-
backward_
op
:
dropout_grad
forward
:
dropout (Tensor x, Tensor seed_tensor, Scalar p, bool is_test, str mode, int seed, bool fix_seed) -> Tensor(out), Tensor(mask)
args
:
(Tensor mask, Tensor out_grad, Scalar p, bool is_test, str mode)
output
:
Tensor(x_grad)
...
...
@@ -654,7 +654,7 @@
kernel
:
func
:
dropout_grad
-
backward_
api
:
eig_grad
-
backward_
op
:
eig_grad
forward
:
eig (Tensor x) -> Tensor(out_w), Tensor(out_v)
args
:
(Tensor out_w, Tensor out_v, Tensor out_w_grad, Tensor out_v_grad)
output
:
Tensor(x_grad)
...
...
@@ -667,7 +667,7 @@
data_transform
:
skip_transform
:
out_w, out_w_grad
-
backward_
api
:
eigh_grad
-
backward_
op
:
eigh_grad
forward
:
eigh (Tensor x, str uplo) -> Tensor(out_w), Tensor(out_v)
args
:
(Tensor out_w, Tensor out_v, Tensor out_w_grad, Tensor out_v_grad)
output
:
Tensor(x_grad)
...
...
@@ -680,7 +680,7 @@
data_transform
:
skip_transform
:
out_w, out_w_grad
-
backward_
api
:
eigvalsh_grad
-
backward_
op
:
eigvalsh_grad
forward
:
eigvalsh (Tensor x, str uplo, bool is_test) -> Tensor(eigenvalues), Tensor(eigenvectors)
args
:
(Tensor eigenvectors, Tensor eigenvalues_grad, str uplo, bool is_test)
output
:
Tensor(x_grad)
...
...
@@ -692,7 +692,7 @@
data_transform
:
skip_transform
:
eigenvalues_grad
-
backward_
api
:
einsum_grad
-
backward_
op
:
einsum_grad
forward
:
einsum (Tensor[] x, str equation) -> Tensor(out), Tensor[](inner_cache), Tensor[](x_shape)
args
:
(Tensor[] x_shape, Tensor[] inner_cache, Tensor out_grad, str equation)
output
:
Tensor[](x_grad){x.size()}
...
...
@@ -702,7 +702,7 @@
kernel
:
func
:
einsum_grad
-
backward_
api
:
elementwise_pow_grad
-
backward_
op
:
elementwise_pow_grad
forward
:
elementwise_pow(Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis=-1)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -712,7 +712,7 @@
kernel
:
func
:
elementwise_pow_grad
-
backward_
api
:
elu_double_grad
-
backward_
op
:
elu_double_grad
forward
:
elu_grad (Tensor x, Tensor out, Tensor grad_out, float alpha)-> Tensor(grad_x)
args
:
(Tensor x, Tensor grad_out, Tensor grad_x_grad, float alpha)
output
:
Tensor(x_grad), Tensor(grad_out_grad)
...
...
@@ -723,7 +723,7 @@
func
:
elu_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
elu_grad
-
backward_
op
:
elu_grad
forward
:
elu (Tensor x, float alpha) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, float alpha)
output
:
Tensor(x_grad)
...
...
@@ -735,13 +735,13 @@
backward
:
elu_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
embedding_grad
-
backward_
op
:
embedding_grad
forward
:
embedding (Tensor x, Tensor weight, int64_t padding_idx=-1, bool sparse=false) -> Tensor(out)
args
:
(Tensor x, Tensor weight, Tensor out_grad, int64_t padding_idx=-1, bool sparse=false)
output
:
Tensor(weight_grad)
invoke
:
embedding_grad_impl(x, weight, out_grad, padding_idx, sparse, weight_grad)
-
backward_
api
:
exp_grad
-
backward_
op
:
exp_grad
forward
:
exp (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -752,7 +752,7 @@
func
:
exp_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
expand_as_grad
-
backward_
op
:
expand_as_grad
forward
:
expand_as (Tensor x, Tensor y, int[] target_shape) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int[] target_shape)
output
:
Tensor(x_grad)
...
...
@@ -763,13 +763,13 @@
func
:
expand_as_grad
no_need_buffer
:
x
-
backward_
api
:
expand_double_grad
-
backward_
op
:
expand_double_grad
forward
:
expand_grad (Tensor x, Tensor grad_out, IntArray shape) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray shape)
output
:
Tensor(grad_out_grad)
invoke
:
expand(grad_x_grad, shape)
-
backward_
api
:
expand_grad
-
backward_
op
:
expand_grad
forward
:
expand (Tensor x, IntArray shape) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, IntArray shape)
output
:
Tensor(x_grad)
...
...
@@ -781,7 +781,7 @@
no_need_buffer
:
x
backward
:
expand_double_grad
-
backward_
api
:
expm1_grad
-
backward_
op
:
expm1_grad
forward
:
expm1 (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -792,7 +792,7 @@
func
:
expm1_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
exponential__grad
-
backward_
op
:
exponential__grad
forward
:
exponential_ (Tensor x, float lambda) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -800,7 +800,7 @@
func
:
UnchangedInferMeta
invoke
:
zeros_like(out_grad)
-
backward_
api
:
fill_diagonal_grad
-
backward_
op
:
fill_diagonal_grad
forward
:
fill_diagonal (Tensor x, float value, int offset, bool wrap) -> Tensor(out)
args
:
(Tensor out_grad, float value, int offset, bool wrap)
output
:
Tensor(x_grad)
...
...
@@ -809,7 +809,7 @@
kernel
:
func
:
fill_diagonal_grad
-
backward_
api
:
fill_diagonal_tensor_grad
-
backward_
op
:
fill_diagonal_tensor_grad
forward
:
fill_diagonal_tensor (Tensor x, Tensor y, int64_t offset, int dim1, int dim2) -> Tensor(out)
args
:
(Tensor out_grad, int64_t offset, int dim1, int dim2)
output
:
Tensor(x_grad)
...
...
@@ -819,7 +819,7 @@
func
:
fill_diagonal_tensor_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
fill_grad
-
backward_
op
:
fill_grad
forward
:
fill (Tensor x, Scalar value) -> Tensor(out)
args
:
(Tensor out_grad, Scalar value)
output
:
Tensor(x_grad)
...
...
@@ -830,7 +830,7 @@
func
:
fill_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
flatten_grad
-
backward_
op
:
flatten_grad
forward
:
flatten(Tensor x, int start_axis, int stop_axis) -> Tensor(out), Tensor(xshape)
args
:
(Tensor xshape, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -844,13 +844,13 @@
layout
:
out_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
flip_grad
-
backward_
op
:
flip_grad
forward
:
flip (Tensor x, int[] axis) -> Tensor(out)
args
:
(Tensor out_grad, int[] axis)
output
:
Tensor(x_grad)
invoke
:
flip(out_grad, axis)
-
backward_
api
:
floor_grad
-
backward_
op
:
floor_grad
forward
:
floor(Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -861,7 +861,7 @@
func
:
floor_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
fmax_grad
-
backward_
op
:
fmax_grad
forward
:
fmax(Tensor x, Tensor y, int axis) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -871,7 +871,7 @@
kernel
:
func
:
fmax_grad
-
backward_
api
:
fmin_grad
-
backward_
op
:
fmin_grad
forward
:
fmin(Tensor x, Tensor y, int axis) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -881,7 +881,7 @@
kernel
:
func
:
fmin_grad
-
backward_
api
:
frame_grad
-
backward_
op
:
frame_grad
forward
:
frame(Tensor x, int frame_length, int hop_length, int axis) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int frame_length, int hop_length, int axis)
output
:
Tensor(x_grad)
...
...
@@ -891,7 +891,7 @@
kernel
:
func
:
frame_grad
-
backward_
api
:
frobenius_norm_grad
-
backward_
op
:
frobenius_norm_grad
forward
:
frobenius_norm(Tensor x, int64_t[] axis, bool keep_dim, bool reduce_all) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int64_t[] axis, bool keep_dim, bool reduce_all)
output
:
Tensor(x_grad)
...
...
@@ -901,7 +901,7 @@
kernel
:
func
:
frobenius_norm_grad
-
backward_
api
:
gather_grad
-
backward_
op
:
gather_grad
forward
:
gather(Tensor x, Tensor index, Scalar axis=0) -> Tensor(out)
args
:
(Tensor x, Tensor index, Tensor out_grad, Scalar axis=0, bool overwrite=false)
output
:
Tensor(x_grad)
...
...
@@ -913,7 +913,7 @@
func
:
gather_grad
no_need_buffer
:
x
-
backward_
api
:
gather_nd_grad
-
backward_
op
:
gather_nd_grad
forward
:
gather_nd (Tensor x, Tensor index) -> Tensor(out)
args
:
(Tensor x, Tensor index, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -924,7 +924,7 @@
func
:
gather_nd_grad
no_need_buffer
:
x
-
backward_
api
:
gelu_grad
-
backward_
op
:
gelu_grad
forward
:
gelu(Tensor x, bool approximate) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, bool approximate)
output
:
Tensor(x_grad)
...
...
@@ -934,7 +934,7 @@
kernel
:
func
:
gelu_grad
-
backward_
api
:
graph_send_recv_grad
-
backward_
op
:
graph_send_recv_grad
forward
:
graph_send_recv (Tensor x, Tensor src_index, Tensor dst_index, str reduce_op = "SUM", IntArray out_size = {0}) -> Tensor(out), Tensor(dst_count)
args
:
(Tensor x, Tensor src_index, Tensor dst_index, Tensor out, Tensor dst_count, Tensor out_grad, str reduce_op = "SUM")
output
:
Tensor(x_grad)
...
...
@@ -946,7 +946,7 @@
data_type
:
out_grad
optional
:
out, dst_count
-
backward_
api
:
graph_send_ue_recv_grad
-
backward_
op
:
graph_send_ue_recv_grad
forward
:
graph_send_ue_recv (Tensor x, Tensor y, Tensor src_index, Tensor dst_index, str message_op, str reduce_op, IntArray out_size) -> Tensor(out), Tensor(dst_count)
args
:
(Tensor x, Tensor y, Tensor src_index, Tensor dst_index, Tensor out, Tensor dst_count, Tensor out_grad, str message_op, str reduce_op)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -958,7 +958,7 @@
data_type
:
out_grad
optional
:
out, dst_count
-
backward_
api
:
grid_sample_grad
-
backward_
op
:
grid_sample_grad
forward
:
grid_sample (Tensor x, Tensor grid, str mode, str padding_mode, bool align_corners) -> Tensor(out)
args
:
(Tensor x, Tensor grid, Tensor out_grad, str mode, str padding_mode, bool align_corners)
output
:
Tensor(x_grad), Tensor(grid_grad)
...
...
@@ -969,7 +969,7 @@
func
:
grid_sample_grad
data_type
:
x
-
backward_
api
:
group_norm_grad
-
backward_
op
:
group_norm_grad
forward
:
group_norm (Tensor x, Tensor scale, Tensor bias, float epsilon, int groups, str data_layout) -> Tensor(y), Tensor(mean), Tensor(variance)
args
:
(Tensor x, Tensor scale, Tensor bias, Tensor y, Tensor mean, Tensor variance, Tensor y_grad, float epsilon, int groups, str data_layout)
output
:
Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
...
...
@@ -982,7 +982,7 @@
optional
:
scale, bias
inplace
:
(y_grad -> x_grad)
-
backward_
api
:
gumbel_softmax_grad
-
backward_
op
:
gumbel_softmax_grad
forward
:
gumbel_softmax (Tensor x, float temperature, bool hard, int axis) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, int axis)
output
:
Tensor(x_grad)
...
...
@@ -992,7 +992,7 @@
kernel
:
func
:
gumbel_softmax_grad
-
backward_
api
:
hard_shrink_grad
-
backward_
op
:
hard_shrink_grad
forward
:
hard_shrink (Tensor x, float threshold) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float threshold)
output
:
Tensor(x_grad)
...
...
@@ -1003,7 +1003,7 @@
func
:
hard_shrink_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
hard_sigmoid_grad
-
backward_
op
:
hard_sigmoid_grad
forward
:
hard_sigmoid (Tensor x, float slope, float offset) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, float slope, float offset)
output
:
Tensor(x_grad)
...
...
@@ -1014,7 +1014,7 @@
func
:
hard_sigmoid_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
hard_swish_grad
-
backward_
op
:
hard_swish_grad
forward
:
hard_swish (Tensor x, float threshold = 6.0, float scale = 6.0, float offset = 3.0) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float threshold, float scale, float offset)
output
:
Tensor(x_grad)
...
...
@@ -1025,7 +1025,7 @@
func
:
hard_swish_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
hierarchical_sigmoid_grad
-
backward_
op
:
hierarchical_sigmoid_grad
forward
:
hierarchical_sigmoid (Tensor x, Tensor w, Tensor label, Tensor path, Tensor code, Tensor bias, int num_classes, bool remote_prefetch, int trainer_id, int64_t[] height_sections, str[] epmap, str[] table_names, bool is_sparse) -> Tensor(out), Tensor(pre_out), Tensor(w_out)
args
:
(Tensor x, Tensor w, Tensor label, Tensor path, Tensor code, Tensor bias, Tensor pre_out, Tensor out_grad, int num_classes, bool remote_prefetch, int trainer_id, int64_t[] height_sections, str[] epmap, str[] table_names, bool is_sparse)
output
:
Tensor(x_grad), Tensor(w_grad), Tensor(bias_grad)
...
...
@@ -1036,7 +1036,7 @@
kernel
:
func
:
hierarchical_sigmoid_grad
-
backward_
api
:
huber_loss_grad
-
backward_
op
:
huber_loss_grad
forward
:
huber_loss (Tensor input, Tensor label, float delta) -> Tensor(out), Tensor(residual)
args
:
(Tensor residual, Tensor out_grad, float delta)
output
:
Tensor(input_grad), Tensor(label_grad)
...
...
@@ -1046,13 +1046,13 @@
kernel
:
func
:
huber_loss_grad
-
backward_
api
:
imag_grad
-
backward_
op
:
imag_grad
forward
:
imag (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
invoke
:
imag_grad_impl(out_grad, x_grad)
-
backward_
api
:
index_add_grad
-
backward_
op
:
index_add_grad
forward
:
index_add(Tensor x, Tensor index, Tensor add_value, int axis) -> Tensor(out)
args
:
(Tensor index, Tensor add_value, Tensor out_grad, int axis)
output
:
Tensor(x_grad), Tensor(add_value_grad)
...
...
@@ -1063,7 +1063,7 @@
data_type
:
out_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
index_sample_grad
-
backward_
op
:
index_sample_grad
forward
:
index_sample (Tensor x, Tensor index) -> Tensor(out)
args
:
(Tensor x, Tensor index, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1075,7 +1075,7 @@
data_type
:
out_grad
no_need_buffer
:
x
-
backward_
api
:
index_select_grad
-
backward_
op
:
index_select_grad
forward
:
index_select(Tensor x, Tensor index, int dim) -> Tensor(out)
args
:
(Tensor x, Tensor index, Tensor out_grad, int dim)
output
:
Tensor(x_grad)
...
...
@@ -1087,7 +1087,7 @@
data_type
:
x
no_need_buffer
:
x
-
backward_
api
:
instance_norm_double_grad
-
backward_
op
:
instance_norm_double_grad
forward
:
instance_norm_grad(Tensor x, Tensor fwd_scale, Tensor saved_mean, Tensor saved_variance, Tensor grad_y, float epsilon) -> Tensor(grad_x), Tensor(grad_scale), Tensor(grad_bias)
args
:
(Tensor x, Tensor fwd_scale, Tensor saved_mean, Tensor saved_variance, Tensor grad_y, Tensor grad_x_grad, Tensor grad_scale_grad, Tensor grad_bias_grad, float epsilon)
output
:
Tensor(x_grad), Tensor(fwd_scale_grad), Tensor(grad_y_grad)
...
...
@@ -1098,7 +1098,7 @@
data_type
:
x
optional
:
fwd_scale, grad_x_grad, grad_scale_grad, grad_bias_grad
-
backward_
api
:
instance_norm_grad
-
backward_
op
:
instance_norm_grad
forward
:
instance_norm(Tensor x, Tensor scale, Tensor bias, float epsilon) -> Tensor(y), Tensor(saved_mean), Tensor(saved_variance)
args
:
(Tensor x, Tensor scale, Tensor saved_mean, Tensor saved_variance, Tensor y_grad, float epsilon)
output
:
Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
...
...
@@ -1110,7 +1110,7 @@
optional
:
scale
backward
:
instance_norm_double_grad
-
backward_
api
:
inverse_grad
-
backward_
op
:
inverse_grad
forward
:
inverse(Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1119,7 +1119,7 @@
kernel
:
func
:
inverse_grad
-
backward_
api
:
kldiv_loss_grad
-
backward_
op
:
kldiv_loss_grad
forward
:
kldiv_loss(Tensor x, Tensor label, str reduction) -> Tensor(out)
args
:
(Tensor x, Tensor label, Tensor out_grad, str reduction)
output
:
Tensor(x_grad)
...
...
@@ -1130,7 +1130,7 @@
func
:
kldiv_loss_grad
no_need_buffer
:
x
-
backward_
api
:
kron_grad
-
backward_
op
:
kron_grad
forward
:
kron (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -1141,7 +1141,7 @@
func
:
kron_grad
data_type
:
out_grad
-
backward_
api
:
kthvalue_grad
-
backward_
op
:
kthvalue_grad
forward
:
kthvalue(Tensor x, int k, int axis, bool keepdim) -> Tensor(out), Tensor(indices)
args
:
(Tensor x, Tensor indices, Tensor out_grad, int k, int axis, bool keepdim)
output
:
Tensor(x_grad)
...
...
@@ -1151,7 +1151,7 @@
kernel
:
func
:
kthvalue_grad
-
backward_
api
:
label_smooth_grad
-
backward_
op
:
label_smooth_grad
forward
:
label_smooth (Tensor label, Tensor prior_dist, float epsilon) -> Tensor(out)
args
:
(Tensor out_grad, float epsilon)
output
:
Tensor(label_grad)
...
...
@@ -1161,7 +1161,7 @@
kernel
:
func
:
label_smooth_grad
-
backward_
api
:
layer_norm_grad
-
backward_
op
:
layer_norm_grad
forward
:
layer_norm (Tensor x, Tensor scale, Tensor bias, float epsilon, int begin_norm_axis, bool is_test) -> Tensor(out), Tensor(mean), Tensor(variance)
args
:
(Tensor x, Tensor scale, Tensor bias, Tensor mean, Tensor variance, Tensor out_grad, float epsilon, int begin_norm_axis, bool is_test)
output
:
Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
...
...
@@ -1174,7 +1174,7 @@
no_need_buffer
:
bias
optional
:
scale, bias
-
backward_
api
:
leaky_relu_double_grad
-
backward_
op
:
leaky_relu_double_grad
forward
:
leaky_relu_grad (Tensor x, Tensor grad_out, float alpha) -> Tensor(grad_x)
args
:
(Tensor x, Tensor grad_x_grad, float alpha)
output
:
Tensor(grad_out_grad)
...
...
@@ -1185,7 +1185,7 @@
func
:
leaky_relu_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
leaky_relu_grad
-
backward_
op
:
leaky_relu_grad
forward
:
leaky_relu (Tensor x, float alpha) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float alpha)
output
:
Tensor(x_grad)
...
...
@@ -1197,7 +1197,7 @@
backward
:
leaky_relu_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
lerp_grad
-
backward_
op
:
lerp_grad
forward
:
lerp (Tensor x, Tensor y, Tensor weight) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor weight, Tensor out, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -1207,7 +1207,7 @@
kernel
:
func
:
lerp_grad
-
backward_
api
:
linear_interp_grad
-
backward_
op
:
linear_interp_grad
forward
:
linear_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
args
:
(Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
output
:
Tensor(x_grad)
...
...
@@ -1219,7 +1219,7 @@
func
:
linear_interp_grad
data_type
:
output_grad
-
backward_
api
:
log10_grad
-
backward_
op
:
log10_grad
forward
:
log10 (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1230,7 +1230,7 @@
func
:
log10_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
log1p_grad
-
backward_
op
:
log1p_grad
forward
:
log1p (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1241,7 +1241,7 @@
func
:
log1p_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
log2_grad
-
backward_
op
:
log2_grad
forward
:
log2 (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1252,7 +1252,7 @@
func
:
log2_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
log_double_grad
-
backward_
op
:
log_double_grad
forward
:
log_grad (Tensor x, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor x, Tensor grad_out, Tensor grad_x_grad)
output
:
Tensor(x_grad), Tensor(grad_out_grad)
...
...
@@ -1263,7 +1263,7 @@
func
:
log_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
log_grad
-
backward_
op
:
log_grad
forward
:
log (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1275,7 +1275,7 @@
backward
:
log_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
log_loss_grad
-
backward_
op
:
log_loss_grad
forward
:
log_loss (Tensor input, Tensor label, float epsilon) -> Tensor(out)
args
:
(Tensor input, Tensor label, Tensor out_grad, float epsilon)
output
:
Tensor(input_grad)
...
...
@@ -1285,7 +1285,7 @@
kernel
:
func
:
log_loss_grad
-
backward_
api
:
log_softmax_grad
-
backward_
op
:
log_softmax_grad
forward
:
log_softmax(Tensor x, int axis) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, int axis)
output
:
Tensor(x_grad)
...
...
@@ -1295,7 +1295,7 @@
kernel
:
func
:
log_softmax_grad
-
backward_
api
:
logcumsumexp_grad
-
backward_
op
:
logcumsumexp_grad
forward
:
logcumsumexp(Tensor x, int axis, bool flatten, bool exclusive, bool reverse) -> Tensor(out)
infer_meta
:
func
:
UnchangedInferMeta
...
...
@@ -1305,7 +1305,7 @@
kernel
:
func
:
logcumsumexp_grad
-
backward_
api
:
logit_grad
-
backward_
op
:
logit_grad
forward
:
logit (Tensor x, float eps = 1e-6f) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float eps)
output
:
Tensor(x_grad)
...
...
@@ -1315,7 +1315,7 @@
kernel
:
func
:
logit_grad
-
backward_
api
:
logsigmoid_grad
-
backward_
op
:
logsigmoid_grad
forward
:
logsigmoid (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1326,7 +1326,7 @@
func
:
logsigmoid_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
logsumexp_grad
-
backward_
op
:
logsumexp_grad
forward
:
logsumexp(Tensor x, int64_t[] axis, bool keepdim, bool reduce_all) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int64_t[] axis, bool keepdim, bool reduce_all)
output
:
Tensor(x_grad)
...
...
@@ -1336,7 +1336,7 @@
kernel
:
func
:
logsumexp_grad
-
backward_
api
:
lu_grad
-
backward_
op
:
lu_grad
forward
:
lu (Tensor x, bool pivot) -> Tensor(out), Tensor(pivots), Tensor(infos)
args
:
(Tensor x, Tensor out, Tensor pivots, Tensor out_grad, bool pivot)
output
:
Tensor(x_grad)
...
...
@@ -1345,7 +1345,7 @@
kernel
:
func
:
lu_grad
-
backward_
api
:
lu_unpack_grad
-
backward_
op
:
lu_unpack_grad
forward
:
lu_unpack (Tensor x, Tensor pivots, bool unpack_ludata, bool unpack_pivots) -> Tensor(pmat), Tensor(l), Tensor(u)
args
:
(Tensor x, Tensor pivots, Tensor l, Tensor u, Tensor pmat, Tensor l_grad, Tensor u_grad, bool unpack_ludata, bool unpack_pivots)
output
:
Tensor(x_grad)
...
...
@@ -1354,7 +1354,7 @@
kernel
:
func
:
lu_unpack_grad
-
backward_
api
:
margin_cross_entropy_grad
-
backward_
op
:
margin_cross_entropy_grad
forward
:
margin_cross_entropy (Tensor logits, Tensor label, bool return_softmax, int ring_id, int rank, int nranks, float margin1, float margin2, float margin3, float scale) -> Tensor(softmax), Tensor(loss)
args
:
(Tensor logits, Tensor label, Tensor softmax, Tensor loss_grad, bool return_softmax, int ring_id, int rank, int nranks, float margin1, float margin2, float margin3, float scale)
output
:
Tensor(logits_grad)
...
...
@@ -1365,7 +1365,7 @@
data_type
:
softmax
inplace
:
(softmax -> logits_grad)
-
backward_
api
:
masked_select_grad
-
backward_
op
:
masked_select_grad
forward
:
masked_select (Tensor x, Tensor mask) -> Tensor(out)
args
:
(Tensor x, Tensor mask, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1377,7 +1377,7 @@
data_type
:
x
no_need_buffer
:
x
-
backward_
api
:
matmul_double_grad
-
backward_
op
:
matmul_double_grad
forward
:
matmul_grad (Tensor x, Tensor y, Tensor grad_out, bool transpose_x=false, bool transpose_y=false) -> Tensor(grad_x), Tensor(grad_y)
args
:
(Tensor x, Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, bool transpose_x=false, bool transpose_y=false)
output
:
Tensor(x_grad), Tensor(y_grad), Tensor(grad_out_grad)
...
...
@@ -1389,7 +1389,7 @@
backward
:
matmul_triple_grad
optional
:
grad_x_grad, grad_y_grad
-
backward_
api
:
matmul_grad
-
backward_
op
:
matmul_grad
forward
:
matmul (Tensor x, Tensor y, bool transpose_x=false, bool transpose_y=false) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, bool transpose_x=false, bool transpose_y=false)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -1400,7 +1400,7 @@
func
:
matmul_grad
backward
:
matmul_double_grad
-
backward_
api
:
matmul_triple_grad
-
backward_
op
:
matmul_triple_grad
forward
:
matmul_double_grad (Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, bool transpose_x=false, bool transpose_y=false) -> Tensor(grad_x), Tensor(grad_y), Tensor(grad_grad_out)
args
:
(Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, Tensor grad_x_grad, Tensor grad_y_grad, Tensor grad_grad_out_grad, bool transpose_x=false, bool transpose_y=false)
output
:
Tensor(x_grad), Tensor(y_grad), Tensor(fwd_grad_out_grad), Tensor(fwd_grad_grad_x_grad), Tensor(fwd_grad_grad_y_grad)
...
...
@@ -1411,7 +1411,7 @@
func
:
matmul_triple_grad
optional
:
grad_x_grad, grad_y_grad, grad_grad_out_grad
-
backward_
api
:
matrix_power_grad
-
backward_
op
:
matrix_power_grad
forward
:
matrix_power (Tensor x, int n) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int n)
output
:
Tensor(x_grad)
...
...
@@ -1421,7 +1421,7 @@
kernel
:
func
:
matrix_power_grad
-
backward_
api
:
max_grad
-
backward_
op
:
max_grad
forward
:
max (Tensor x, IntArray dims={}, bool keep_dim=false) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, IntArray dims={}, bool keep_dim=false, bool reduce_all=false)
output
:
Tensor(x_grad)
...
...
@@ -1431,7 +1431,7 @@
kernel
:
func
:
max_grad
-
backward_
api
:
max_pool2d_with_index_grad
-
backward_
op
:
max_pool2d_with_index_grad
forward
:
max_pool2d_with_index(Tensor x, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive) -> Tensor(out), Tensor(mask)
args
:
(Tensor x, Tensor mask, Tensor out_grad, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive)
output
:
Tensor(x_grad)
...
...
@@ -1440,7 +1440,7 @@
kernel
:
func
:
max_pool2d_with_index_grad
-
backward_
api
:
max_pool3d_with_index_grad
-
backward_
op
:
max_pool3d_with_index_grad
forward
:
max_pool3d_with_index(Tensor x, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive) -> Tensor(out), Tensor(mask)
args
:
(Tensor x, Tensor mask, Tensor out_grad, int[] kernel_size, int[] strides, int[] paddings, bool global_pooling, bool adaptive)
output
:
Tensor(x_grad)
...
...
@@ -1449,7 +1449,7 @@
kernel
:
func
:
max_pool3d_with_index_grad
-
backward_
api
:
maximum_grad
-
backward_
op
:
maximum_grad
forward
:
maximum(Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis=-1)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -1459,7 +1459,7 @@
kernel
:
func
:
maximum_grad
-
backward_
api
:
maxout_grad
-
backward_
op
:
maxout_grad
forward
:
maxout(Tensor x, int groups, int axis) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int groups, int axis)
output
:
Tensor(x_grad)
...
...
@@ -1469,7 +1469,7 @@
kernel
:
func
:
maxout_grad
-
backward_
api
:
mean_all_grad
-
backward_
op
:
mean_all_grad
forward
:
mean_all(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1479,13 +1479,13 @@
kernel
:
func
:
mean_all_grad
-
backward_
api
:
mean_double_grad
-
backward_
op
:
mean_double_grad
forward
:
mean_grad (Tensor x, Tensor grad_out, IntArray dims={}, bool keep_dim=false, bool reduce_all =
false
) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray dims={}, bool keep_dim=false)
output
:
Tensor(grad_out_grad)
invoke
:
mean(grad_x_grad, dims, keep_dim)
-
backward_
api
:
mean_grad
-
backward_
op
:
mean_grad
forward
:
mean (Tensor x, IntArray dims={}, bool keep_dim=false) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, IntArray dims={}, bool keep_dim=false, bool reduce_all=false)
output
:
Tensor(x_grad)
...
...
@@ -1497,7 +1497,7 @@
backward
:
mean_double_grad
no_need_buffer
:
x
-
backward_
api
:
meshgrid_grad
-
backward_
op
:
meshgrid_grad
forward
:
meshgrid (Tensor[] inputs) -> Tensor[](outputs)
args
:
(Tensor[] inputs, Tensor[] outputs_grad)
output
:
Tensor[](inputs_grad){inputs.size()}
...
...
@@ -1506,7 +1506,7 @@
kernel
:
func
:
meshgrid_grad
-
backward_
api
:
min_grad
-
backward_
op
:
min_grad
forward
:
min (Tensor x, IntArray dims={}, bool keep_dim=false) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, IntArray dims={}, bool keep_dim=false, bool reduce_all=false)
output
:
Tensor(x_grad)
...
...
@@ -1516,7 +1516,7 @@
kernel
:
func
:
min_grad
-
backward_
api
:
minimum_grad
-
backward_
op
:
minimum_grad
forward
:
minimum(Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis=-1)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -1526,7 +1526,7 @@
kernel
:
func
:
minimum_grad
-
backward_
api
:
mish_grad
-
backward_
op
:
mish_grad
forward
:
mish (Tensor x, float threshold) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float threshold)
output
:
Tensor(x_grad)
...
...
@@ -1537,7 +1537,7 @@
func
:
mish_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
mode_grad
-
backward_
op
:
mode_grad
forward
:
mode(Tensor x, int axis, bool keepdim) -> Tensor(out), Tensor(indices)
args
:
(Tensor x, Tensor indices, Tensor out_grad, int axis, bool keepdim)
output
:
Tensor(x_grad)
...
...
@@ -1547,7 +1547,7 @@
kernel
:
func
:
mode_grad
-
backward_
api
:
multi_dot_grad
-
backward_
op
:
multi_dot_grad
forward
:
multi_dot (Tensor[] x) -> Tensor(out)
args
:
(Tensor[] x, Tensor out_grad)
output
:
Tensor[](x_grad) {x.size()}
...
...
@@ -1556,7 +1556,7 @@
kernel
:
func
:
multi_dot_grad
-
backward_
api
:
multiplex_grad
-
backward_
op
:
multiplex_grad
forward
:
multiplex (Tensor[] ins, Tensor ids) -> Tensor(out)
args
:
(Tensor[] ins, Tensor ids, Tensor out_grad)
output
:
Tensor[](ins_grad){ins.size()}
...
...
@@ -1567,7 +1567,7 @@
func
:
multiplex_grad
param
:
[
ids
,
out_grad
]
-
backward_
api
:
multiply_double_grad
-
backward_
op
:
multiply_double_grad
forward
:
multiply_grad (Tensor x, Tensor y, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
args
:
(Tensor x, Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
output
:
Tensor(x_grad), Tensor(y_grad), Tensor(grad_out_grad)
...
...
@@ -1580,7 +1580,7 @@
backward
:
multiply_triple_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
multiply_grad
-
backward_
op
:
multiply_grad
forward
:
multiply (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis = -1)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -1591,7 +1591,7 @@
func
:
multiply_grad
backward
:
multiply_double_grad
-
backward_
api
:
multiply_triple_grad
-
backward_
op
:
multiply_triple_grad
forward
:
multiply_double_grad (Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, int aixs = -1) -> Tensor(grad_x), Tensor(grad_y), Tensor(grad_grad_out)
args
:
(Tensor x, Tensor y, Tensor fwd_grad_out, Tensor fwd_grad_grad_x, Tensor fwd_grad_grad_y, Tensor grad_x_grad, Tensor grad_y_grad, Tensor grad_grad_out_grad, int axis = -1)
output
:
Tensor(x_grad), Tensor(y_grad), Tensor(fwd_grad_out_grad), Tensor(fwd_grad_grad_x_grad), Tensor(fwd_grad_grad_y_grad)
...
...
@@ -1602,7 +1602,7 @@
func
:
multiply_triple_grad
optional
:
fwd_grad_grad_x, fwd_grad_grad_y, grad_grad_out_grad
-
backward_
api
:
nearest_interp_grad
-
backward_
op
:
nearest_interp_grad
forward
:
nearest_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
args
:
(Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
output
:
Tensor(x_grad)
...
...
@@ -1614,7 +1614,7 @@
func
:
nearest_interp_grad
data_type
:
output_grad
-
backward_
api
:
nll_loss_grad
-
backward_
op
:
nll_loss_grad
forward
:
nll_loss (Tensor input, Tensor label, Tensor weight, int64_t ignore_index, str reduction) -> Tensor(out), Tensor(total_weight)
args
:
(Tensor input, Tensor label, Tensor weight, Tensor total_weight, Tensor out_grad, int64_t ignore_index, str reduction)
output
:
Tensor(input_grad)
...
...
@@ -1625,7 +1625,7 @@
data_type
:
input
optional
:
weight
-
backward_
api
:
norm_grad
-
backward_
op
:
norm_grad
forward
:
norm (Tensor x, int axis, float epsilon, bool is_test) -> Tensor(out), Tensor(norm)
args
:
(Tensor x, Tensor norm, Tensor out_grad, int axis, float epsilon, bool is_test)
output
:
Tensor(x_grad)
...
...
@@ -1635,7 +1635,7 @@
kernel
:
func
:
norm_grad
-
backward_
api
:
overlap_add_grad
-
backward_
op
:
overlap_add_grad
forward
:
overlap_add(Tensor x, int hop_length, int axis) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int hop_length, int axis)
output
:
Tensor(x_grad)
...
...
@@ -1645,7 +1645,7 @@
func
:
overlap_add_grad
data_type
:
x
-
backward_
api
:
p_norm_grad
-
backward_
op
:
p_norm_grad
forward
:
p_norm(Tensor x, float porder, int axis, float epsilon, bool keepdim, bool asvector=false) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, float porder, int axis, float epsilon, bool keepdim, bool asvector)
output
:
Tensor(x_grad)
...
...
@@ -1655,7 +1655,7 @@
kernel
:
func
:
p_norm_grad
-
backward_
api
:
pad3d_double_grad
-
backward_
op
:
pad3d_double_grad
forward
:
pad3d_grad(Tensor x, Tensor grad_out, IntArray paddings, str mode, float pad_value, str data_format) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray paddings, str mode, float pad_value, str data_format)
output
:
Tensor(grad_out_grad)
...
...
@@ -1664,7 +1664,7 @@
kernel
:
func
:
pad3d
-
backward_
api
:
pad3d_grad
-
backward_
op
:
pad3d_grad
forward
:
pad3d(Tensor x, IntArray paddings, str mode, float pad_value, str data_format) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, IntArray paddings, str mode, float pad_value, str data_format)
output
:
Tensor(x_grad)
...
...
@@ -1676,7 +1676,7 @@
no_need_buffer
:
x
backward
:
pad3d_double_grad
-
backward_
api
:
pad_double_grad
-
backward_
op
:
pad_double_grad
forward
:
pad_grad(Tensor x, Tensor grad_out, int[] paddings, Scalar pad_value) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, int[] paddings, Scalar pad_value)
output
:
Tensor(grad_out_grad)
...
...
@@ -1685,7 +1685,7 @@
kernel
:
func
:
pad
-
backward_
api
:
pad_grad
-
backward_
op
:
pad_grad
forward
:
pad(Tensor x, int[] paddings, Scalar pad_value) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int[] paddings, Scalar pad_value)
output
:
Tensor(x_grad)
...
...
@@ -1698,7 +1698,7 @@
no_need_buffer
:
x
backward
:
pad_double_grad
-
backward_
api
:
pixel_shuffle_grad
-
backward_
op
:
pixel_shuffle_grad
forward
:
pixel_shuffle (Tensor x, int upscale_factor, str data_format) -> Tensor(out)
args
:
(Tensor out_grad, int upscale_factor, str data_format)
output
:
Tensor(x_grad)
...
...
@@ -1707,7 +1707,7 @@
kernel
:
func
:
pixel_shuffle_grad
-
backward_
api
:
pool2d_double_grad
-
backward_
op
:
pool2d_double_grad
forward
:
pool2d_grad(Tensor x, Tensor out, Tensor grad_out, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm, bool use_gpudnn) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm, bool use_gpudnn)
output
:
Tensor(grad_out_grad)
...
...
@@ -1719,7 +1719,7 @@
param
:
[
grad_x_grad
,
kernel_size
,
strides
,
paddings
,
ceil_mode
,
exclusive
,
data_format
,
pooling_type
,
global_pooling
,
adaptive
,
padding_algorithm
]
use_gpudnn
:
use_gpudnn
-
backward_
api
:
pool2d_grad
-
backward_
op
:
pool2d_grad
forward
:
pool2d(Tensor x, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm, bool use_gpudnn) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm, bool use_gpudnn)
output
:
Tensor(x_grad)
...
...
@@ -1732,7 +1732,7 @@
use_gpudnn
:
use_gpudnn
backward
:
pool2d_double_grad
-
backward_
api
:
pool3d_grad
-
backward_
op
:
pool3d_grad
forward
:
pool3d(Tensor x, int[] kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm, bool use_gpudnn) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, int[] kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm, bool use_gpudnn)
output
:
Tensor(x_grad)
...
...
@@ -1744,7 +1744,7 @@
param
:
[
x
,
out
,
out_grad
,
kernel_size
,
strides
,
paddings
,
ceil_mode
,
exclusive
,
data_format
,
pooling_type
,
global_pooling
,
adaptive
,
padding_algorithm
]
use_gpudnn
:
use_gpudnn
-
backward_
api
:
pow_grad
-
backward_
op
:
pow_grad
forward
:
pow(Tensor x, Scalar s) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, Scalar s=-1)
output
:
Tensor(x_grad)
...
...
@@ -1755,7 +1755,7 @@
func
:
pow_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
prelu_grad
-
backward_
op
:
prelu_grad
forward
:
prelu(Tensor x, Tensor alpha, str data_format, str mode) -> Tensor(out)
args
:
(Tensor x, Tensor alpha, Tensor out_grad, str data_format, str mode)
output
:
Tensor(x_grad), Tensor(alpha_grad)
...
...
@@ -1765,7 +1765,7 @@
kernel
:
func
:
prelu_grad
-
backward_
api
:
psroi_pool_grad
-
backward_
op
:
psroi_pool_grad
forward
:
psroi_pool (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, int output_channels, float spatial_scale) -> Tensor(out)
args
:
(Tensor x, Tensor boxes, Tensor boxes_num, Tensor out_grad, int pooled_height, int pooled_width, int output_channels, float spatial_scale)
output
:
Tensor(x_grad)
...
...
@@ -1778,7 +1778,7 @@
optional
:
boxes_num
# output is optional
-
backward_
api
:
put_along_axis_grad
-
backward_
op
:
put_along_axis_grad
forward
:
put_along_axis (Tensor x, Tensor index, Tensor value, int axis, str reduce) -> Tensor(out)
args
:
(Tensor x, Tensor index, Tensor out_grad, int axis, str reduce)
output
:
Tensor(x_grad), Tensor(value_grad)
...
...
@@ -1788,7 +1788,7 @@
kernel
:
func
:
put_along_axis_grad
-
backward_
api
:
qr_grad
-
backward_
op
:
qr_grad
forward
:
qr (Tensor x, str mode) -> Tensor(q), Tensor(r)
args
:
(Tensor x, Tensor q, Tensor r, Tensor q_grad, Tensor r_grad, str mode)
output
:
Tensor(x_grad)
...
...
@@ -1798,13 +1798,13 @@
kernel
:
func
:
qr_grad
-
backward_
api
:
real_grad
-
backward_
op
:
real_grad
forward
:
real (Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
invoke
:
real_grad_impl(out_grad, x_grad)
-
backward_
api
:
reciprocal_grad
-
backward_
op
:
reciprocal_grad
forward
:
reciprocal (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1815,7 +1815,7 @@
func
:
reciprocal_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
reduce_prod_grad
-
backward_
op
:
reduce_prod_grad
forward
:
reduce_prod (Tensor x, IntArray dims, bool keep_dim, bool reduce_all) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad, IntArray dims, bool keep_dim, bool reduce_all)
output
:
Tensor(x_grad)
...
...
@@ -1825,7 +1825,7 @@
kernel
:
func
:
prod_grad
-
backward_
api
:
relu6_grad
-
backward_
op
:
relu6_grad
forward
:
relu6 (Tensor x, float threshold) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, float threshold)
output
:
Tensor(x_grad)
...
...
@@ -1836,7 +1836,7 @@
func
:
relu6_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
relu_double_grad
-
backward_
op
:
relu_double_grad
forward
:
relu_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor out, Tensor grad_x_grad)
output
:
Tensor(grad_out_grad)
...
...
@@ -1847,7 +1847,7 @@
func
:
relu_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
relu_grad
-
backward_
op
:
relu_grad
forward
:
relu (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1859,7 +1859,7 @@
backward
:
relu_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
renorm_grad
-
backward_
op
:
renorm_grad
forward
:
renorm (Tensor x, float p, int axis, float max_norm) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float p, int axis, float max_norm)
output
:
Tensor(x_grad)
...
...
@@ -1869,7 +1869,7 @@
kernel
:
func
:
renorm_grad
-
backward_
api
:
repeat_interleave_grad
-
backward_
op
:
repeat_interleave_grad
forward
:
repeat_interleave(Tensor x, int repeats, int dim) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int repeats, int dim)
output
:
Tensor(x_grad)
...
...
@@ -1879,7 +1879,7 @@
kernel
:
func
:
repeat_interleave_grad
-
backward_
api
:
repeat_interleave_with_tensor_index_grad
-
backward_
op
:
repeat_interleave_with_tensor_index_grad
forward
:
repeat_interleave_with_tensor_index(Tensor x, Tensor repeats, int dim) -> Tensor(out)
args
:
(Tensor x, Tensor repeats, Tensor out_grad, int dim)
output
:
Tensor(x_grad)
...
...
@@ -1890,7 +1890,7 @@
func
:
repeat_interleave_with_tensor_index_grad
data_type
:
x
-
backward_
api
:
reshape_double_grad
-
backward_
op
:
reshape_double_grad
forward
:
reshape_grad (Tensor xshape, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor grad_out, Tensor grad_x_grad)
output
:
Tensor(grad_out_grad)
...
...
@@ -1902,7 +1902,7 @@
no_need_buffer
:
grad_out
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
reshape_grad
-
backward_
op
:
reshape_grad
forward
:
reshape (Tensor x, IntArray shape) -> Tensor(out), Tensor(xshape)
args
:
(Tensor xshape, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1918,7 +1918,7 @@
backward
:
reshape_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
reverse_array_grad
-
backward_
op
:
reverse_array_grad
forward
:
reverse_array (Tensor[] x, IntArray axis) -> Tensor[](out)
args
:
(Tensor[] out_grad, IntArray axis)
output
:
Tensor[](x_grad){out_grad.size()}
...
...
@@ -1927,13 +1927,13 @@
kernel
:
func
:
reverse
-
backward_
api
:
reverse_grad
-
backward_
op
:
reverse_grad
forward
:
reverse (Tensor x, IntArray axis) -> Tensor(out)
args
:
(Tensor out_grad, IntArray axis)
output
:
Tensor(x_grad)
invoke
:
reverse(out_grad, axis)
-
backward_
api
:
roi_align_grad
-
backward_
op
:
roi_align_grad
forward
:
roi_align (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, float spatial_scale, int sampling_ratio, bool aligned) -> Tensor(out)
args
:
(Tensor x, Tensor boxes, Tensor boxes_num, Tensor out_grad, int pooled_height, int pooled_width, float spatial_scale, int sampling_ratio, bool aligned)
output
:
Tensor(x_grad)
...
...
@@ -1946,7 +1946,7 @@
no_need_buffer
:
x
optional
:
boxes_num
-
backward_
api
:
roi_pool_grad
-
backward_
op
:
roi_pool_grad
forward
:
roi_pool (Tensor x, Tensor boxes, Tensor boxes_num, int pooled_height, int pooled_width, float spatial_scale) -> Tensor(out), Tensor(arg_max)
args
:
(Tensor x, Tensor boxes, Tensor boxes_num, Tensor arg_max, Tensor out_grad, int pooled_height, int pooled_width, float spatial_scale)
output
:
Tensor(x_grad)
...
...
@@ -1958,7 +1958,7 @@
data_type
:
x
optional
:
boxes_num
-
backward_
api
:
roll_grad
-
backward_
op
:
roll_grad
forward
:
roll(Tensor x, IntArray shifts, int64_t[] axis) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, IntArray shifts, int64_t[] axis)
output
:
Tensor(x_grad)
...
...
@@ -1970,7 +1970,7 @@
data_type
:
x
no_need_buffer
:
x
-
backward_
api
:
round_grad
-
backward_
op
:
round_grad
forward
:
round(Tensor x) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -1981,7 +1981,7 @@
func
:
round_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
rsqrt_double_grad
-
backward_
op
:
rsqrt_double_grad
forward
:
rsqrt_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor out, Tensor grad_x, Tensor grad_x_grad)
output
:
Tensor(out_grad), Tensor(grad_out_grad)
...
...
@@ -1992,7 +1992,7 @@
func
:
rsqrt_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
rsqrt_grad
-
backward_
op
:
rsqrt_grad
forward
:
rsqrt (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2004,13 +2004,13 @@
backward
:
rsqrt_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
scale_grad
-
backward_
op
:
scale_grad
forward
:
scale (Tensor x, Scalar scale, float bias, bool bias_after_scale) -> Tensor(out)
args
:
(Tensor out_grad, Scalar scale=1.0, bool bias_after_scale=true)
output
:
Tensor(x_grad)
invoke
:
scale(out_grad, scale, 0.0, bias_after_scale)
-
backward_
api
:
scatter_grad
-
backward_
op
:
scatter_grad
forward
:
scatter (Tensor x, Tensor index, Tensor updates, bool overwrite) -> Tensor(out)
args
:
(Tensor index, Tensor updates, Tensor out_grad, bool overwrite)
output
:
Tensor(x_grad), Tensor(updates_grad)
...
...
@@ -2021,7 +2021,7 @@
func
:
scatter_grad
no_need_buffer
:
updates
-
backward_
api
:
scatter_nd_add_grad
-
backward_
op
:
scatter_nd_add_grad
forward
:
scatter_nd_add (Tensor x, Tensor index, Tensor updates) -> Tensor(out)
args
:
(Tensor index, Tensor updates, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(updates_grad)
...
...
@@ -2032,7 +2032,7 @@
func
:
scatter_nd_add_grad
no_need_buffer
:
updates
-
backward_
api
:
segment_pool_grad
-
backward_
op
:
segment_pool_grad
forward
:
segment_pool (Tensor x, Tensor segment_ids, str pooltype) -> Tensor(out), Tensor(summed_ids)
args
:
(Tensor x, Tensor segment_ids, Tensor out, Tensor summed_ids, Tensor out_grad, str pooltype)
output
:
Tensor(x_grad)
...
...
@@ -2044,7 +2044,7 @@
data_type
:
x
optional
:
summed_ids
-
backward_
api
:
selu_grad
-
backward_
op
:
selu_grad
forward
:
selu (Tensor x, float scale, float alpha) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, float scale, float alpha)
output
:
Tensor(x_grad)
...
...
@@ -2054,7 +2054,7 @@
kernel
:
func
:
selu_grad
-
backward_
api
:
sigmoid_cross_entropy_with_logits_grad
-
backward_
op
:
sigmoid_cross_entropy_with_logits_grad
forward
:
sigmoid_cross_entropy_with_logits (Tensor x, Tensor label, bool normalize, int ignore_index) -> Tensor(out)
args
:
(Tensor x, Tensor label, Tensor out_grad, bool normalize, int ignore_index)
output
:
Tensor(x_grad)
...
...
@@ -2065,7 +2065,7 @@
func
:
sigmoid_cross_entropy_with_logits_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
sigmoid_double_grad
-
backward_
op
:
sigmoid_double_grad
forward
:
sigmoid_grad (Tensor out, Tensor fwd_grad_out) -> Tensor(grad_x)
args
:
(Tensor out, Tensor fwd_grad_out, Tensor grad_x_grad)
output
:
Tensor(out_grad), Tensor(fwd_grad_out_grad)
...
...
@@ -2077,7 +2077,7 @@
backward
:
sigmoid_triple_grad
inplace
:
(grad_x_grad -> fwd_grad_out_grad)
-
backward_
api
:
sigmoid_grad
-
backward_
op
:
sigmoid_grad
forward
:
sigmoid (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2089,7 +2089,7 @@
backward
:
sigmoid_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
sigmoid_triple_grad
-
backward_
op
:
sigmoid_triple_grad
forward
:
sigmoid_double_grad (Tensor out, Tensor fwd_grad_out, Tensor grad_grad_x) -> Tensor(grad_out), Tensor(grad_grad_out)
args
:
(Tensor out, Tensor fwd_grad_out, Tensor grad_grad_x, Tensor grad_out_grad, Tensor grad_grad_out_grad)
output
:
Tensor(out_grad), Tensor(fwd_grad_out_grad), Tensor(grad_grad_x_grad)
...
...
@@ -2101,7 +2101,7 @@
optional
:
grad_grad_out_grad
inplace
:
(grad_grad_x -> fwd_grad_out_grad)
-
backward_
api
:
silu_grad
-
backward_
op
:
silu_grad
forward
:
silu (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2112,7 +2112,7 @@
func
:
silu_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
sin_grad
-
backward_
op
:
sin_grad
forward
:
sin (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2123,7 +2123,7 @@
func
:
sin_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
sinh_grad
-
backward_
op
:
sinh_grad
forward
:
sinh (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2134,13 +2134,13 @@
func
:
sinh_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
slice_double_grad
-
backward_
op
:
slice_double_grad
forward
:
slice_grad (Tensor input, Tensor grad_out, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis) -> Tensor(grad_input)
args
:
(Tensor grad_input_grad, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis)
output
:
Tensor(grad_out_grad)
invoke
:
slice(grad_input_grad, axes, starts, ends, infer_flags, decrease_axis)
-
backward_
api
:
slice_grad
-
backward_
op
:
slice_grad
forward
:
slice (Tensor input, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis) -> Tensor(out)
args
:
(Tensor input, Tensor out_grad, int64_t[] axes, IntArray starts, IntArray ends, int64_t[] infer_flags, int64_t[] decrease_axis)
output
:
Tensor(input_grad)
...
...
@@ -2152,7 +2152,7 @@
backward
:
slice_double_grad
no_need_buffer
:
input
-
backward_
api
:
slogdet_grad
-
backward_
op
:
slogdet_grad
forward
:
slogdet (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2162,7 +2162,7 @@
kernel
:
func
:
slogdeterminant_grad
-
backward_
api
:
soft_shrink_grad
-
backward_
op
:
soft_shrink_grad
forward
:
soft_shrink (Tensor x, float lambda) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float lambda)
output
:
Tensor(x_grad)
...
...
@@ -2173,7 +2173,7 @@
func
:
soft_shrink_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
softmax_grad
-
backward_
op
:
softmax_grad
forward
:
softmax (Tensor x, int axis) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, int axis)
output
:
Tensor(x_grad)
...
...
@@ -2184,7 +2184,7 @@
func
:
softmax_grad
use_gpudnn
:
true
-
backward_
api
:
softplus_grad
-
backward_
op
:
softplus_grad
forward
:
softplus (Tensor x, float beta, float threshold) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float beta, float threshold)
output
:
Tensor(x_grad)
...
...
@@ -2195,7 +2195,7 @@
func
:
softplus_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
softsign_grad
-
backward_
op
:
softsign_grad
forward
:
softsign (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2206,7 +2206,7 @@
func
:
softsign_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
spectral_norm_grad
-
backward_
op
:
spectral_norm_grad
forward
:
spectral_norm (Tensor weight, Tensor u, Tensor v, int dim, int power_iters, float eps) -> Tensor(out)
args
:
(Tensor weight, Tensor u, Tensor v, Tensor out_grad, int dim, int power_iters, float eps)
output
:
Tensor(weight_grad)
...
...
@@ -2216,20 +2216,20 @@
func
:
spectral_norm_grad
data_type
:
out_grad
-
backward_
api
:
split_grad
-
backward_
op
:
split_grad
forward
:
split (Tensor x, IntArray num_or_sections, Scalar axis) -> Tensor[](out)
args
:
(Tensor[] out_grad, Scalar axis = -1)
output
:
Tensor(x_grad)
invoke
:
concat( out_grad, axis)
-
backward_
api
:
split_with_num_grad
-
backward_
op
:
split_with_num_grad
forward
:
split_with_num (Tensor x, int num, Scalar axis) -> Tensor[](out)
args
:
(Tensor[] out_grad, Scalar axis = -1)
output
:
Tensor(x_grad)
invoke
:
concat( out_grad, axis)
# TODO(zhangyunfei) The config of double grad and triple grad will be supported in the future.
-
backward_
api
:
sqrt_double_grad
-
backward_
op
:
sqrt_double_grad
forward
:
sqrt_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor out, Tensor grad_x, Tensor grad_x_grad)
output
:
Tensor(out_grad), Tensor(grad_out_grad)
...
...
@@ -2240,7 +2240,7 @@
func
:
sqrt_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
sqrt_grad
-
backward_
op
:
sqrt_grad
forward
:
sqrt (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2252,7 +2252,7 @@
backward
:
sqrt_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
square_double_grad
-
backward_
op
:
square_double_grad
forward
:
square_grad (Tensor x, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor x, Tensor grad_out, Tensor grad_x_grad)
output
:
Tensor(x_grad), Tensor(grad_out_grad)
...
...
@@ -2263,7 +2263,7 @@
func
:
square_double_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
square_grad
-
backward_
op
:
square_grad
forward
:
square (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2275,7 +2275,7 @@
backward
:
square_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
squared_l2_norm_grad
-
backward_
op
:
squared_l2_norm_grad
forward
:
squared_l2_norm(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2285,13 +2285,13 @@
kernel
:
func
:
squared_l2_norm_grad
-
backward_
api
:
squeeze_double_grad
-
backward_
op
:
squeeze_double_grad
forward
:
squeeze_grad(Tensor xshape, Tensor grad_out, IntArray axes) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray axes)
output
:
Tensor(grad_out_grad)
invoke
:
squeeze(grad_x_grad, axes)
-
backward_
api
:
squeeze_grad
-
backward_
op
:
squeeze_grad
forward
:
squeeze(Tensor x, IntArray axes) -> Tensor(out), Tensor(xshape)
args
:
(Tensor xshape, Tensor out_grad, IntArray axes)
output
:
Tensor(x_grad)
...
...
@@ -2303,7 +2303,7 @@
inplace
:
(out_grad -> x_grad)
backward
:
squeeze_double_grad
-
backward_
api
:
stack_grad
-
backward_
op
:
stack_grad
forward
:
stack (Tensor[] x, int axis) -> Tensor(out)
args
:
(Tensor[] x, Tensor out_grad, int axis)
output
:
Tensor[](x_grad){x.size()}
...
...
@@ -2315,7 +2315,7 @@
param
:
[
out_grad
,
axis
]
no_need_buffer
:
x
-
backward_
api
:
strided_slice_grad
-
backward_
op
:
strided_slice_grad
forward
:
strided_slice (Tensor x, int[] axes, IntArray starts, IntArray ends, IntArray strides) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int[] axes, IntArray starts, IntArray ends, IntArray strides)
output
:
Tensor(x_grad)
...
...
@@ -2326,7 +2326,7 @@
func
:
strided_slice_grad
no_need_buffer
:
x
-
backward_
api
:
subtract_double_grad
-
backward_
op
:
subtract_double_grad
forward
:
subtract_grad (Tensor x, Tensor y, Tensor grad_out, int axis = -1) -> Tensor(grad_x), Tensor(grad_y)
args
:
(Tensor y, Tensor grad_out, Tensor grad_x_grad, Tensor grad_y_grad, int axis = -1)
output
:
Tensor(grad_out_grad)
...
...
@@ -2339,7 +2339,7 @@
no_need_buffer
:
y, grad_out
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
subtract_grad
-
backward_
op
:
subtract_grad
forward
:
subtract (Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad, int axis = -1)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -2352,13 +2352,13 @@
backward
:
subtract_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
sum_double_grad
-
backward_
op
:
sum_double_grad
forward
:
sum_grad (Tensor x, Tensor grad_out, IntArray dims, bool keep_dim, bool reduce_all=false) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray dims={}, bool keep_dim=false)
output
:
Tensor(grad_out_grad)
invoke
:
sum(grad_x_grad, dims, grad_x_grad.dtype(), keep_dim)
-
backward_
api
:
sum_grad
-
backward_
op
:
sum_grad
forward
:
sum (Tensor x, IntArray dims={}, DataType out_dtype=DataType::UNDEFINED, bool keep_dim=false) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, IntArray dims, bool keep_dim, bool reduce_all=false)
output
:
Tensor(x_grad)
...
...
@@ -2370,7 +2370,7 @@
no_need_buffer
:
x
backward
:
sum_double_grad
-
backward_
api
:
svd_grad
-
backward_
op
:
svd_grad
forward
:
svd (Tensor x, bool full) -> Tensor(u), Tensor(s), Tensor(vh)
args
:
(Tensor x, Tensor u, Tensor vh, Tensor s, Tensor u_grad, Tensor vh_grad, Tensor s_grad, bool full)
output
:
Tensor(x_grad)
...
...
@@ -2381,7 +2381,7 @@
func
:
svd_grad
optional
:
u_grad, vh_grad, s_grad
-
backward_
api
:
swish_grad
-
backward_
op
:
swish_grad
forward
:
swish (Tensor x, float beta=1.0) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float bete=1.0)
output
:
Tensor(x_grad)
...
...
@@ -2392,7 +2392,7 @@
func
:
swish_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
sync_batch_norm_grad
-
backward_
op
:
sync_batch_norm_grad
forward
:
sync_batch_norm_ (Tensor x, Tensor scale, Tensor bias, Tensor mean, Tensor variance, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space)
args
:
(Tensor x, Tensor scale, Tensor bias, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu)
output
:
Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad)
...
...
@@ -2404,7 +2404,7 @@
data_type
:
out_grad
optional
:
reserve_space
-
backward_
api
:
take_along_axis_grad
-
backward_
op
:
take_along_axis_grad
forward
:
take_along_axis (Tensor x, Tensor index, int axis) -> Tensor(out)
args
:
(Tensor x, Tensor index, Tensor out_grad, int axis)
output
:
Tensor(x_grad)
...
...
@@ -2414,7 +2414,7 @@
kernel
:
func
:
take_along_axis_grad
-
backward_
api
:
tan_grad
-
backward_
op
:
tan_grad
forward
:
tan (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2425,7 +2425,7 @@
func
:
tan_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
tanh_double_grad
-
backward_
op
:
tanh_double_grad
forward
:
tanh_grad (Tensor out, Tensor grad_out) -> Tensor(grad_x)
args
:
(Tensor out, Tensor grad_out, Tensor grad_x_grad)
output
:
Tensor(out_grad), Tensor(grad_out_grad)
...
...
@@ -2437,7 +2437,7 @@
backward
:
tanh_triple_grad
inplace
:
(grad_x_grad -> grad_out_grad)
-
backward_
api
:
tanh_grad
-
backward_
op
:
tanh_grad
forward
:
tanh (Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2449,7 +2449,7 @@
backward
:
tanh_double_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
tanh_shrink_grad
-
backward_
op
:
tanh_shrink_grad
forward
:
tanh_shrink (Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -2460,7 +2460,7 @@
func
:
tanh_shrink_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
tanh_triple_grad
-
backward_
op
:
tanh_triple_grad
forward
:
tanh_double_grad (Tensor out, Tensor grad_out_forward, Tensor grad_x_grad_forward) -> Tensor(grad_out_new), Tensor(grad_out_grad)
args
:
(Tensor out, Tensor grad_out_forward, Tensor grad_x_grad_forward, Tensor grad_out_new_grad, Tensor grad_out_grad_grad)
output
:
Tensor(out_grad), Tensor(grad_out_forward_grad), Tensor(grad_x_grad_forward_grad)
...
...
@@ -2471,7 +2471,7 @@
func
:
tanh_triple_grad
inplace
:
(grad_x_grad_forward -> grad_out_forward_grad)
-
backward_
api
:
temporal_shift_grad
-
backward_
op
:
temporal_shift_grad
forward
:
temporal_shift(Tensor x, int seg_num, float shift_ratio, str data_format_str) -> Tensor(out)
args
:
(Tensor out_grad, int seg_num, float shift_ratio, str data_format_str)
output
:
Tensor(x_grad)
...
...
@@ -2481,7 +2481,7 @@
kernel
:
func
:
temporal_shift_grad
-
backward_
api
:
thresholded_relu_grad
-
backward_
op
:
thresholded_relu_grad
forward
:
thresholded_relu (Tensor x, float threshold) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float threshold)
output
:
Tensor(x_grad)
...
...
@@ -2492,13 +2492,13 @@
func
:
thresholded_relu_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
tile_double_grad
-
backward_
op
:
tile_double_grad
forward
:
tile_grad (Tensor x, Tensor grad_out, IntArray repeat_times) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray repeat_times)
output
:
Tensor(grad_out_grad)
invoke
:
tile(grad_x_grad, repeat_times)
-
backward_
api
:
tile_grad
-
backward_
op
:
tile_grad
forward
:
tile (Tensor x, IntArray repeat_times) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, IntArray repeat_times)
output
:
Tensor(x_grad)
...
...
@@ -2510,7 +2510,7 @@
no_need_buffer
:
x
backward
:
tile_double_grad
-
backward_
api
:
top_k_grad
-
backward_
op
:
top_k_grad
forward
:
top_k (Tensor x, Scalar k, int axis = -1, bool largest =
true
, bool sorted =
true
) -> Tensor(out), Tensor(indices)
args
:
(Tensor x, Tensor indices, Tensor out_grad, Scalar k = -1, int axis = -1, bool largest =
true
, bool sorted =
true
)
output
:
Tensor(x_grad)
...
...
@@ -2520,13 +2520,13 @@
kernel
:
func
:
top_k_grad
-
backward_
api
:
transpose_double_grad
-
backward_
op
:
transpose_double_grad
forward
:
transpose_grad (Tensor grad_out, int[] axis) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, int[] axis)
output
:
Tensor(grad_out_grad)
invoke
:
transpose(grad_x_grad, axis)
-
backward_
api
:
transpose_grad
-
backward_
op
:
transpose_grad
forward
:
transpose (Tensor x, int[] axis) -> Tensor(out)
args
:
(Tensor out_grad, int[] axis)
output
:
Tensor(x_grad)
...
...
@@ -2537,7 +2537,7 @@
func
:
transpose_grad
backward
:
transpose_double_grad
-
backward_
api
:
triangular_solve_grad
-
backward_
op
:
triangular_solve_grad
forward
:
triangular_solve (Tensor x, Tensor y, bool upper, bool tranpose, bool unitriangular) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out, Tensor out_grad, bool upper, bool tranpose, bool unitriangular)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -2547,7 +2547,7 @@
kernel
:
func
:
triangular_solve_grad
-
backward_
api
:
tril_triu_grad
-
backward_
op
:
tril_triu_grad
forward
:
tril_triu(Tensor x, int diagonal, bool lower) -> Tensor(out)
args
:
(Tensor out_grad, int diagonal, bool lower)
output
:
Tensor(x_grad)
...
...
@@ -2557,7 +2557,7 @@
kernel
:
func
:
tril_triu_grad
-
backward_
api
:
trilinear_interp_grad
-
backward_
op
:
trilinear_interp_grad
forward
:
trilinear_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode) -> Tensor(output)
args
:
(Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
output
:
Tensor(x_grad)
...
...
@@ -2569,13 +2569,13 @@
func
:
trilinear_interp_grad
data_type
:
output_grad
-
backward_
api
:
unbind_grad
-
backward_
op
:
unbind_grad
forward
:
unbind (Tensor input, int axis) -> Tensor[](out)
args
:
(Tensor[] out_grad, int axis)
output
:
Tensor(input_grad)
invoke
:
stack(out_grad, axis)
-
backward_
api
:
unfold_grad
-
backward_
op
:
unfold_grad
forward
:
unfold (Tensor x, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations)
output
:
Tensor(x_grad)
...
...
@@ -2586,7 +2586,7 @@
func
:
unfold_grad
no_need_buffer
:
x
-
backward_
api
:
uniform_random_inplace_grad
-
backward_
op
:
uniform_random_inplace_grad
forward
:
uniform_random_inplace(Tensor x, float min, float max, int seed, int diag_num, int diag_step, float diag_val) -> Tensor(out)
args
:
(Tensor out_grad, float min, float max, int seed, int diag_num, int diag_step, float diag_val)
output
:
Tensor(x_grad)
...
...
@@ -2596,13 +2596,13 @@
func
:
uniform_random_inplace_grad
inplace
:
(out_grad -> x_grad)
-
backward_
api
:
unsqueeze_double_grad
-
backward_
op
:
unsqueeze_double_grad
forward
:
unsqueeze_grad(Tensor xshape, Tensor grad_out, IntArray axes) -> Tensor(grad_x)
args
:
(Tensor grad_x_grad, IntArray axes)
output
:
Tensor(grad_out_grad)
invoke
:
unsqueeze(grad_x_grad, axes)
-
backward_
api
:
unsqueeze_grad
-
backward_
op
:
unsqueeze_grad
forward
:
unsqueeze(Tensor x, IntArray axes) -> Tensor(out), Tensor(xshape)
args
:
(Tensor xshape, Tensor out_grad, IntArray axes)
output
:
Tensor(x_grad)
...
...
@@ -2615,7 +2615,7 @@
inplace
:
(out_grad -> x_grad)
backward
:
unsqueeze_double_grad
-
backward_
api
:
unstack_grad
-
backward_
op
:
unstack_grad
forward
:
unstack (Tensor x, int axis, int num) -> Tensor[](out)
args
:
(Tensor[] out_grad, int axis)
output
:
Tensor(x_grad)
...
...
@@ -2625,7 +2625,7 @@
kernel
:
func
:
unstack_grad
-
backward_
api
:
warpctc_grad
-
backward_
op
:
warpctc_grad
forward
:
warpctc (Tensor logits, Tensor label, Tensor logits_length, Tensor labels_length, int blank, bool norm_by_times) -> Tensor(loss), Tensor(warpctcgrad)
args
:
(Tensor logits, Tensor logits_length, Tensor warpctcgrad, Tensor loss_grad, int blank, bool norm_by_times)
output
:
Tensor(logits_grad)
...
...
@@ -2637,7 +2637,7 @@
optional
:
logits_length
no_need_buffer
:
logits
-
backward_
api
:
where_grad
-
backward_
op
:
where_grad
forward
:
where (Tensor condition, Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor condition, Tensor x, Tensor y, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
...
...
@@ -2648,7 +2648,7 @@
func
:
where_grad
no_need_buffer
:
x, y
-
backward_
api
:
yolov3_loss_grad
-
backward_
op
:
yolov3_loss_grad
forward
:
yolov3_loss(Tensor x, Tensor gt_box, Tensor gt_label, Tensor gt_score, int[] anchors, int[] anchor_mask, int class_num, float ignore_thresh, int downsample_ratio, bool use_label_smooth=true, float scale_x_y=1.0) -> Tensor(loss), Tensor(objectness_mask), Tensor(gt_match_mask)
args
:
(Tensor x, Tensor gt_box, Tensor gt_label, Tensor gt_score, Tensor objectness_mask, Tensor gt_match_mask, Tensor loss_grad, int[] anchors, int[] anchor_mask, int class_num, float ignore_thresh, int downsample_ratio, bool use_label_smooth=true, float scale_x_y=1.0)
output
:
Tensor(x_grad), Tensor(gt_box_grad), Tensor(gt_label_grad), Tensor(gt_score_grad)
...
...
@@ -2658,7 +2658,7 @@
func
:
yolov3_loss_grad
optional
:
gt_score
-
backward_
api
:
fold_grad
-
backward_
op
:
fold_grad
forward
:
fold (Tensor x, int[] output_sizes, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, int[] output_sizes, int[] kernel_sizes, int[] strides, int[] paddings, int[] dilations)
output
:
Tensor(x_grad)
...
...
@@ -2669,7 +2669,7 @@
func
:
fold_grad
no_need_buffer
:
x
-
backward_
api
:
unpool3d_grad
-
backward_
op
:
unpool3d_grad
forward
:
unpool3d (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format) -> Tensor(out)
args
:
(Tensor x, Tensor indices, Tensor out, Tensor out_grad, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format)
output
:
Tensor(x_grad)
...
...
@@ -2680,7 +2680,7 @@
func
:
unpool3d_grad
data_type
:
x
-
backward_
api
:
unpool_grad
-
backward_
op
:
unpool_grad
forward
:
unpool (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding, IntArray output_size, str data_format) -> Tensor(out)
args
:
(Tensor x, Tensor indices, Tensor out, Tensor out_grad, int[] ksize, int[] strides, int[] padding, IntArray output_size, str data_format)
output
:
Tensor(x_grad)
...
...
paddle/phi/api/yaml/sparse_backward.yaml
浏览文件 @
6891a4fe
-
backward_
api
:
abs_grad
-
backward_
op
:
abs_grad
forward
:
tanh(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -6,7 +6,7 @@
func
:
abs_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
abs_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
acos_grad
-
backward_
op
:
acos_grad
forward
:
acos(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -14,7 +14,7 @@
func
:
acos_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
acos_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
acosh_grad
-
backward_
op
:
acosh_grad
forward
:
acosh(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -22,7 +22,7 @@
func
:
acosh_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
acosh_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
add_grad
-
backward_
op
:
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)
...
...
@@ -30,7 +30,7 @@
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}
-
backward_
api
:
addmm_grad
-
backward_
op
:
addmm_grad
forward
:
addmm(Tensor input, Tensor x, Tensor y, float alpha=1.0, float beta=1.0) -> Tensor(out)
args
:
(Tensor input, Tensor x, Tensor y, Tensor out_grad, float alpha=1.0, float beta=1.0)
output
:
Tensor(input_grad), Tensor(x_grad), Tensor(y_grad)
...
...
@@ -40,7 +40,7 @@
addmm_coo_dense_grad {dense, sparse_coo, dense, dense -> dense, sparse_coo, dense},
addmm_coo_coo_grad {sparse_coo, sparse_coo, sparse_coo, sparse_coo -> sparse_coo, sparse_coo, sparse_coo}
-
backward_
api
:
asin_grad
-
backward_
op
:
asin_grad
forward
:
asin(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -48,7 +48,7 @@
func
:
asin_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
asin_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
asinh_grad
-
backward_
op
:
asinh_grad
forward
:
asinh(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -56,7 +56,7 @@
func
:
asinh_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
asinh_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
atan_grad
-
backward_
op
:
atan_grad
forward
:
atan(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -64,7 +64,7 @@
func
:
atan_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
atan_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
atanh_grad
-
backward_
op
:
atanh_grad
forward
:
atanh(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -72,7 +72,7 @@
func
:
atanh_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
atanh_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
cast_grad
-
backward_
op
:
cast_grad
forward
:
cast(Tensor x, DataType index_dtype, DataType value_dtype) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, DataType value_dtype)
output
:
Tensor(x_grad)
...
...
@@ -81,14 +81,14 @@
cast_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
data_type
:
out_grad
-
backward_
api
:
conv3d_coo_grad
-
backward_
op
:
conv3d_coo_grad
forward
:
conv3d_coo (Tensor x, Tensor kernel, int[] paddings, int[] dilations, int[] strides, int groups, bool subm, str key) -> Tensor(out), Tensor(rulebook), Tensor(counter)
args
:
(Tensor x, Tensor kernel, Tensor out, Tensor rulebook, Tensor counter, Tensor out_grad, int[] paddings, int[] dilations, int[] strides, int groups, bool subm, str key)
output
:
Tensor(x_grad), Tensor(kernel_grad)
kernel
:
func
:
conv3d_coo_grad{sparse_coo, dense, sparse_coo, dense, dense, sparse_coo -> sparse_coo, dense}
-
backward_
api
:
divide_grad
-
backward_
op
:
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)
...
...
@@ -96,13 +96,13 @@
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}
-
backward_
api
:
divide_scalar_grad
-
backward_
op
:
divide_scalar_grad
forward
:
divide_scalar (Tensor x, float scalar) -> Tensor(out)
args
:
(Tensor out_grad, float scalar)
output
:
Tensor(x_grad)
invoke
:
divide_scalar(out_grad, scalar)
-
backward_
api
:
expm1_grad
-
backward_
op
:
expm1_grad
forward
:
expm1(Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -110,7 +110,7 @@
func
:
expm1_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
expm1_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
leaky_relu_grad
-
backward_
op
:
leaky_relu_grad
forward
:
leaky_relu(Tensor x, float alpha) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float alpha)
output
:
Tensor(x_grad)
...
...
@@ -118,7 +118,7 @@
func
:
leaky_relu_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
leaky_relu_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
log1p_grad
-
backward_
op
:
log1p_grad
forward
:
log1p(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -126,14 +126,14 @@
func
:
log1p_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
log1p_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
masked_matmul_grad
-
backward_
op
:
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
:
masked_matmul_csr_grad{dense, dense, sparse_csr -> dense, dense}
-
backward_
api
:
matmul_grad
-
backward_
op
:
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)
...
...
@@ -143,14 +143,14 @@
matmul_coo_dense_grad {sparse_coo, dense, dense -> sparse_coo, dense},
matmul_coo_coo_grad {sparse_coo, sparse_coo, sparse_coo -> sparse_coo, sparse_coo}
-
backward_
api
:
maxpool_grad
-
backward_
op
:
maxpool_grad
forward
:
maxpool(Tensor x, int[] kernel_sizes, int[] paddings, int[] dilations, int[] strides) -> Tensor(out), Tensor(rulebook), Tensor(counter)
args
:
(Tensor x, Tensor rulebook, Tensor counter, Tensor out, Tensor out_grad, int[] kernel_sizes)
output
:
Tensor(x_grad)
kernel
:
func
:
maxpool_coo_grad {sparse_coo, dense, dense, sparse_coo, sparse_coo -> sparse_coo}
-
backward_
api
:
multiply_grad
-
backward_
op
:
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)
...
...
@@ -158,7 +158,7 @@
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}
-
backward_
api
:
mv_grad
-
backward_
op
:
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)
...
...
@@ -166,7 +166,7 @@
func
:
mv_coo_grad{sparse_coo, dense, dense -> sparse_coo, dense},
mv_csr_grad{sparse_csr, dense, dense -> sparse_csr, dense}
-
backward_
api
:
pow_grad
-
backward_
op
:
pow_grad
forward
:
pow(Tensor x, float factor) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad, float factor)
output
:
Tensor(x_grad)
...
...
@@ -174,7 +174,7 @@
func
:
pow_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
pow_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
relu6_grad
-
backward_
op
:
relu6_grad
forward
:
relu6(Tensor x, float threshold) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad, float threshold)
output
:
Tensor(x_grad)
...
...
@@ -182,7 +182,7 @@
func
:
relu6_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
relu6_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
relu_grad
-
backward_
op
:
relu_grad
forward
:
relu(Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -190,13 +190,13 @@
func
:
relu_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
relu_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
scale_grad
-
backward_
op
:
scale_grad
forward
:
scale(Tensor x, float scale, float bias, bool bias_after_scale) -> Tensor(out)
args
:
(Tensor out_grad, float scale)
output
:
Tensor(x_grad)
invoke
:
scale(out_grad, scale, 0.0,
true
)
-
backward_
api
:
sin_grad
-
backward_
op
:
sin_grad
forward
:
sin(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -204,7 +204,7 @@
func
:
sin_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
sin_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
sinh_grad
-
backward_
op
:
sinh_grad
forward
:
sinh(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -212,21 +212,21 @@
func
:
sinh_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
sinh_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
softmax_grad
-
backward_
op
:
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}
-
backward_
api
:
sparse_coo_tensor_grad
-
backward_
op
:
sparse_coo_tensor_grad
forward
:
sparse_coo_tensor(Tensor values, Tensor indices, IntArray dense_shape) -> Tensor(out)
args
:
(Tensor indices, Tensor out_grad)
output
:
Tensor(values_grad)
kernel
:
func
:
sparse_coo_tensor_grad{dense, sparse_coo -> dense}
-
backward_
api
:
sqrt_grad
-
backward_
op
:
sqrt_grad
forward
:
sqrt(Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -234,7 +234,7 @@
func
:
sqrt_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
sqrt_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
square_grad
-
backward_
op
:
square_grad
forward
:
square(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -242,7 +242,7 @@
func
:
square_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
square_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
subtract_grad
-
backward_
op
:
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)
...
...
@@ -250,7 +250,7 @@
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}
-
backward_
api
:
tan_grad
-
backward_
op
:
tan_grad
forward
:
tan(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -258,7 +258,7 @@
func
:
tan_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
tan_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
tanh_grad
-
backward_
op
:
tanh_grad
forward
:
tanh(Tensor x) -> Tensor(out)
args
:
(Tensor out, Tensor out_grad)
output
:
Tensor(x_grad)
...
...
@@ -266,28 +266,28 @@
func
:
tanh_coo_grad {sparse_coo, sparse_coo -> sparse_coo},
tanh_csr_grad {sparse_csr, sparse_csr -> sparse_csr}
-
backward_
api
:
to_dense_grad
-
backward_
op
:
to_dense_grad
forward
:
to_dense(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
kernel
:
func
:
coo_to_dense_grad{sparse_coo, dense -> sparse_coo}
-
backward_
api
:
to_sparse_coo_grad
-
backward_
op
:
to_sparse_coo_grad
forward
:
to_sparse_coo(Tensor x, int64_t sparse_dim) -> Tensor(out)
args
:
(Tensor out_grad)
output
:
Tensor(x_grad)
kernel
:
func
:
coo_to_dense { sparse_coo -> dense }
-
backward_
api
:
values_grad
-
backward_
op
:
values_grad
forward
:
values_coo(Tensor x) -> Tensor(out)
args
:
(Tensor x, Tensor out_grad)
output
:
Tensor(x_grad)
kernel
:
func
:
values_coo_grad{sparse_coo, dense-> sparse_coo}
-
backward_
api
:
fused_attention_grad
-
backward_
op
:
fused_attention_grad
forward
:
fused_attention_csr(Tensor query, Tensor key, Tensor value, Tensor sparse_mask, Tensor key_padding_mask, Tensor attn_mask) -> Tensor(out), Tensor(softmax)
args
:
(Tensor query, Tensor key, Tensor value, Tensor softmax, Tensor out_grad)
output
:
Tensor(query_grad), Tensor(key_grad), Tensor(value_grad)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录