forked from mindspore-Ecosystem/mindspore
!45735 Add bprop mindir for some array ops
Merge pull request !45735 from YuJianfeng/master
This commit is contained in:
commit
025add5df1
|
@ -38,6 +38,7 @@ class GetMetaFg : public AnfVisitor {
|
|||
{"logical_not", {"logical_not", "mindspore.ops.composite.multitype_ops.logic_not_impl"}},
|
||||
{"in", {"in_", "mindspore.ops.composite.multitype_ops.in_impl"}},
|
||||
{"less", {"less", "mindspore.ops.composite.multitype_ops.less_impl"}},
|
||||
{"less_equal", {"less_equal", "mindspore.ops.composite.multitype_ops.less_equal_impl"}},
|
||||
{"greater", {"greater", "mindspore.ops.composite.multitype_ops.greater_impl"}},
|
||||
{"add", {"add", "mindspore.ops.composite.multitype_ops.add_impl"}},
|
||||
{"sub", {"sub", "mindspore.ops.composite.multitype_ops.sub_impl"}},
|
||||
|
|
|
@ -159,12 +159,6 @@ def bprop_embed(x, out, dout):
|
|||
return (C.zeros_like(x),)
|
||||
|
||||
|
||||
@bprops.register("StopGradient")
|
||||
def bprop_stop_gradient(x, out, dout):
|
||||
"""Backpropagator for primitive `StopGradient`."""
|
||||
return (C.zeros_like(x),)
|
||||
|
||||
|
||||
@bprops.register("Switch")
|
||||
def bprop_switch(cond, tb, fb, out, dout):
|
||||
"""Backpropagator for primitive `switch`."""
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:×
|
||||
w(get_bprop_batch_to_space_nd.1:[CNode]2:1(get_bprop_batch_to_space_nd.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
?[ValueNode]4[ValueNode]4"Constant*
|
||||
value*block_shape€
|
||||
«
|
||||
"get_bprop_batch_to_space_nd.1:self
|
||||
[ValueNode]4(get_bprop_batch_to_space_nd.1:[CNode]5:2(get_bprop_batch_to_space_nd.1:[CNode]5:2"REF::getattr:3:Default/getattr-op1
|
||||
9[ValueNode]6[ValueNode]6"Constant*
|
||||
value*crops€
|
||||
«
|
||||
"get_bprop_batch_to_space_nd.1:self
|
||||
[ValueNode]6(get_bprop_batch_to_space_nd.1:[CNode]7:4(get_bprop_batch_to_space_nd.1:[CNode]7:4"REF::getattr:3:Default/getattr-op2
|
||||
Î
|
||||
(get_bprop_batch_to_space_nd.1:[CNode]5:2
|
||||
(get_bprop_batch_to_space_nd.1:[CNode]7:46get_bprop_batch_to_space_nd.1:batch_to_space_nd_grad:56get_bprop_batch_to_space_nd.1:batch_to_space_nd_grad:5"AREF::ClassType::mindspore.ops.operations.array_ops.SpaceToBatchND:EDefault/class 'mindspore.ops.operations.array_ops.SpaceToBatchND'-op3get_bprop_batch_to_space_nd.1*$
|
||||
"get_bprop_batch_to_space_nd.1:self*!
|
||||
get_bprop_batch_to_space_nd.1:x*#
|
||||
!get_bprop_batch_to_space_nd.1:out*$
|
||||
"get_bprop_batch_to_space_nd.1:dout2*
|
||||
(get_bprop_batch_to_space_nd.1:[CNode]2:1:@bae659ee9c4ba628e8eb4986b38e636fc494d3625431852b881adfb243c2e261J/grad_array_ops.pyB‘
|
||||
€
|
||||
"get_bprop_batch_to_space_nd.1:doutbprop.3:dx:6bprop.3:dx:6";REF::get_bprop_batch_to_space_nd.1:batch_to_space_nd_grad:5:4
|
||||
m
|
||||
bprop.3:dx:6bprop.3:[CNode]8:7bprop.3:[CNode]8:7"REF::S-Prim-MakeTuple:8:Default/S-Prim-MakeTuple-op5bprop.32
|
||||
bprop.3:[CNode]8:7Pb
|
||||
getattr:3getattrb&
|
||||
S-Prim-MakeTuple:8S-Prim-MakeTupleh
|
|
@ -0,0 +1,192 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:‹
|
||||
m#get_bprop_broadcast_to.1:[CNode]2:1#get_bprop_broadcast_to.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
=3636"Constant*)
|
||||
value*mindspore.ops._grad.grad_base€"
|
||||
:36_2936_29"Constant*
|
||||
value*sum_grad_reduce_axis€#
|
||||
r
|
||||
36
|
||||
36_29get_bprop_broadcast_to.1:36:30get_bprop_broadcast_to.1:36:30"REF::resolve:31:Default/resolve-op24
|
||||
?
[ValueNode]47
[ValueNode]47"Constant*
|
||||
value* keep_dims€
|
||||
–
|
||||
[ValueNode]47%get_bprop_broadcast_to.1:[CNode]48:49%get_bprop_broadcast_to.1:[CNode]48:49"REF::S-Prim-MakeTuple:50:Default/S-Prim-MakeTuple-op37
|
||||
6
[ValueNode]49
[ValueNode]49"Constant*
|
||||
value€
|
||||
–
|
||||
[ValueNode]49%get_bprop_broadcast_to.1:[CNode]50:51%get_bprop_broadcast_to.1:[CNode]50:51"REF::S-Prim-MakeTuple:52:Default/S-Prim-MakeTuple-op38
|
||||
Õ
|
||||
%get_bprop_broadcast_to.1:[CNode]48:49
|
||||
%get_bprop_broadcast_to.1:[CNode]50:51%get_bprop_broadcast_to.1:[CNode]51:53%get_bprop_broadcast_to.1:[CNode]51:53"REF::S-Prim-make_dict:54:Default/S-Prim-make_dict-op39
|
||||
K5252"Constant*7
|
||||
value*+mindspore.ops.operations.math_ops.ReduceSum€!
|
||||
Ã
|
||||
52
|
||||
%get_bprop_broadcast_to.1:[CNode]51:53+get_bprop_broadcast_to.1:reduce_keep_dim:55+get_bprop_broadcast_to.1:reduce_keep_dim:55"REF::MetaFuncGraph::unpack_call:Default/unpack_call.53-op40get_bprop_broadcast_to.1*
|
||||
get_bprop_broadcast_to.1:self*
|
||||
get_bprop_broadcast_to.1:x*
|
||||
get_bprop_broadcast_to.1:out*
|
||||
get_bprop_broadcast_to.1:dout2%
|
||||
#get_bprop_broadcast_to.1:[CNode]2:1:@ae92671003cbb7bf6d76699d1ef878db26dee85e473879f241cafc92a59532ffJ/grad_array_ops.pyB¬
|
||||
q
|
||||
get_bprop_broadcast_to.1:xbprop.3:x_shape:2bprop.3:x_shape:2"REF::S-Prim-Shape:3:Default/S-Prim-Shape-op1
|
||||
€
|
||||
bprop.3:x_shape:2bprop.3:[CNode]4:4bprop.3:[CNode]4:4"REF::S-Prim-is_shape_unknown:5:#Default/S-Prim-is_shape_unknown-op2
|
||||
_
|
||||
bprop.3:[CNode]4:4bprop.3:[CNode]5:6bprop.3:[CNode]5:6"REF::bool_.6:Default/bool_.6-op3
|
||||
w
|
||||
bprop.3:[CNode]5:6
|
||||
|
||||
↰bprop.7
|
||||
|
||||
↱bprop.8bprop.3:[CNode]9:7bprop.3:[CNode]9:7"
REF::Switch:8:Default/Switch-op4
|
||||
Bbprop.3:dynamic:9bprop.3:dynamic:9"REF::bprop.3:[CNode]9:7:5
|
||||
€
|
||||
bprop.3:dynamic:9bprop.3:[CNode]10:10bprop.3:[CNode]10:10"REF::MetaFuncGraph::logical_not:Default/S-Prim-logical_not-op6
|
||||
e
|
||||
bprop.3:[CNode]10:10bprop.3:[CNode]11:11bprop.3:[CNode]11:11"REF::bool_.6:Default/bool_.6-op7
|
||||
|
||||
bprop.3:[CNode]11:11
|
||||
↰bprop.12
|
||||
↱bprop.13bprop.3:[CNode]14:12bprop.3:[CNode]14:12"
REF::Switch:8:Default/Switch-op8
|
||||
Jbprop.3:[CNode]15:13bprop.3:[CNode]15:13"REF::bprop.3:[CNode]14:12:9
|
||||
f
|
||||
bprop.3:[CNode]15:13bprop.3:[CNode]16:14bprop.3:[CNode]16:14"REF::bool_.6:Default/bool_.6-op10
|
||||
€
|
||||
bprop.3:[CNode]16:14
|
||||
✓bprop.17
|
||||
✗bprop.18bprop.3:[CNode]19:15bprop.3:[CNode]19:15"
REF::Switch:8:Default/Switch-op11
|
||||
Kbprop.3:[CNode]20:16bprop.3:[CNode]20:16"REF::bprop.3:[CNode]19:15:12
|
||||
†
|
||||
get_bprop_broadcast_to.1:outbprop.3:broadcast_shape:56bprop.3:broadcast_shape:56"REF::S-Prim-Shape:3:Default/S-Prim-Shape-op41
|
||||
}
|
||||
get_bprop_broadcast_to.1:doutbprop.3:dout_shape:66bprop.3:dout_shape:66"REF::S-Prim-Shape:3:Default/S-Prim-Shape-op49bprop.32
|
||||
bprop.3:[CNode]20:16B‹
|
||||
`✗bprop.18:[CNode]21:17✗bprop.18:[CNode]21:17"REF::↓bprop.22:Default/↓bprop.22-op13✗bprop.182
|
||||
✗bprop.18:[CNode]21:17BŠ
|
||||
k
|
||||
bprop.3:dynamic:9↓bprop.22:[CNode]23:18↓bprop.22:[CNode]23:18"REF::bool_.6:Default/bool_.6-op14
|
||||
’
|
||||
↓bprop.22:[CNode]23:18
|
||||
↰↓bprop.24
|
||||
↱↓bprop.25↓bprop.22:[CNode]26:19↓bprop.22:[CNode]26:19"
REF::Switch:8:Default/Switch-op15
|
||||
S↓bprop.22:dynamic:20↓bprop.22:dynamic:20"REF::↓bprop.22:[CNode]26:19:16
|
||||
Ž
|
||||
↓bprop.22:dynamic:20↓bprop.22:[CNode]27:21↓bprop.22:[CNode]27:21"REF::MetaFuncGraph::logical_not:Default/S-Prim-logical_not-op17
|
||||
r
|
||||
↓bprop.22:[CNode]27:21↓bprop.22:[CNode]28:22↓bprop.22:[CNode]28:22"REF::bool_.6:Default/bool_.6-op18
|
||||
’
|
||||
↓bprop.22:[CNode]28:22
|
||||
✓↓bprop.29
|
||||
✗↓bprop.30↓bprop.22:[CNode]31:23↓bprop.22:[CNode]31:23"
REF::Switch:8:Default/Switch-op19
|
||||
W↓bprop.22:[CNode]32:24↓bprop.22:[CNode]32:24"REF::↓bprop.22:[CNode]31:23:20
|
||||
€
|
||||
↓bprop.22:[CNode]32:24↓bprop.22:[CNode]33:25↓bprop.22:[CNode]33:25"REF::↓↓bprop.34:Default/↓↓bprop.34-op21↓bprop.222
|
||||
↓bprop.22:[CNode]33:25B
|
||||
after_block€ Bå
|
||||
ˆ
|
||||
↓↓bprop.34:фdx↓↓bprop.34:[CNode]35:26↓↓bprop.34:[CNode]35:26"REF::S-Prim-MakeTuple:27:Default/S-Prim-MakeTuple-op22↓↓bprop.34*
|
||||
↓↓bprop.34:фdx2
|
||||
↓↓bprop.34:[CNode]35:26B
|
||||
after_block€ BÄ
|
||||
©âœ—↓bprop.30:dx:28✗↓bprop.30:dx:28":REF::ClassType::mindspore.ops.operations.array_ops.Reshape:?Default/class 'mindspore.ops.operations.array_ops.Reshape'-op23
|
||||
ã✗↓bprop.30:[CNode]37:32✗↓bprop.30:[CNode]37:32"PREF::ClassType::mindspore.ops.operations._inner_ops.DynamicBroadcastGradientArgs:UDefault/class 'mindspore.ops.operations._inner_ops.DynamicBroadcastGradientArgs'-op25
|
||||
¡
|
||||
get_bprop_broadcast_to.1:out!✗↓bprop.30:broadcast_shape:33!✗↓bprop.30:broadcast_shape:33"REF::S-Prim-TensorShape:34:Default/S-Prim-TensorShape-op26
|
||||
<EFBFBD>
|
||||
get_bprop_broadcast_to.1:x✗↓bprop.30:x_shape:35✗↓bprop.30:x_shape:35"REF::S-Prim-TensorShape:34:Default/S-Prim-TensorShape-op27
|
||||
ž
|
||||
!✗↓bprop.30:broadcast_shape:33
|
||||
✗↓bprop.30:x_shape:35✗↓bprop.30:[CNode]38:36✗↓bprop.30:[CNode]38:36" REF::✗↓bprop.30:[CNode]37:32:28
|
||||
6
[ValueNode]39
[ValueNode]39"Constant*
|
||||
value€
|
||||
ª
|
||||
✗↓bprop.30:[CNode]38:36
|
||||
[ValueNode]39 ✗↓bprop.30:reduction_axes:37 ✗↓bprop.30:reduction_axes:37"REF::MetaFuncGraph::getitem:Default/S-Prim-getitem-op29
|
||||
´
|
||||
get_bprop_broadcast_to.1:dout
|
||||
✗↓bprop.30:reduction_axes:37✗↓bprop.30:[CNode]40:38✗↓bprop.30:[CNode]40:38"REF::S-Prim-MakeTuple:39:Default/S-Prim-MakeTuple-op30
|
||||
?
[ValueNode]41
[ValueNode]41"Constant*
|
||||
value* keep_dims€
|
||||
‚
|
||||
[ValueNode]41✗↓bprop.30:[CNode]42:40✗↓bprop.30:[CNode]42:40"REF::S-Prim-MakeTuple:41:Default/S-Prim-MakeTuple-op31
|
||||
6
[ValueNode]43
[ValueNode]43"Constant*
|
||||
value€
|
||||
‚
|
||||
[ValueNode]43✗↓bprop.30:[CNode]44:42✗↓bprop.30:[CNode]44:42"REF::S-Prim-MakeTuple:43:Default/S-Prim-MakeTuple-op32
|
||||
|
||||
✗↓bprop.30:[CNode]42:40
|
||||
✗↓bprop.30:[CNode]44:42✗↓bprop.30:[CNode]45:44✗↓bprop.30:[CNode]45:44"REF::S-Prim-make_dict:45:Default/S-Prim-make_dict-op33
|
||||
Ø
|
||||
get_bprop_broadcast_to.1:36:30
|
||||
✗↓bprop.30:[CNode]40:38
|
||||
✗↓bprop.30:[CNode]45:44✗↓bprop.30:reduced_grad:46✗↓bprop.30:reduced_grad:46"REF::MetaFuncGraph::unpack_call:Default/unpack_call.46-op34
|
||||
†
|
||||
✗↓bprop.30:reduced_grad:46
|
||||
✗↓bprop.30:x_shape:35✗↓bprop.30:dx:47✗↓bprop.30:dx:47"REF::✗↓bprop.30:dx:28:35✗↓bprop.302
|
||||
✗↓bprop.30:dx:47B°
|
||||
©âœ“↓bprop.29:dx:48✓↓bprop.29:dx:48":REF::ClassType::mindspore.ops.operations.array_ops.Reshape:?Default/class 'mindspore.ops.operations.array_ops.Reshape'-op36
|
||||
º
|
||||
bprop.3:broadcast_shape:56
|
||||
bprop.3:x_shape:2✓↓bprop.29:[CNode]54:57✓↓bprop.29:[CNode]54:57"$REF::S-Prim-BroadcastGradientArgs:58:)Default/S-Prim-BroadcastGradientArgs-op42
|
||||
6
[ValueNode]55
[ValueNode]55"Constant*
|
||||
value€
|
||||
ª
|
||||
✓↓bprop.29:[CNode]54:57
|
||||
[ValueNode]55 ✓↓bprop.29:reduction_axes:59 ✓↓bprop.29:reduction_axes:59"REF::MetaFuncGraph::getitem:Default/S-Prim-getitem-op43
|
||||
·
|
||||
get_bprop_broadcast_to.1:dout
|
||||
✓↓bprop.29:reduction_axes:59✓↓bprop.29:reduced_grad:60✓↓bprop.29:reduced_grad:60"0REF::get_bprop_broadcast_to.1:reduce_keep_dim:55:44
|
||||
~
|
||||
✓↓bprop.29:reduced_grad:60
|
||||
bprop.3:x_shape:2✓↓bprop.29:dx:61✓↓bprop.29:dx:61"REF::✓↓bprop.29:dx:48:45✓↓bprop.292
|
||||
✓↓bprop.29:dx:61Bª
|
||||
>
[ValueNode]56
[ValueNode]56"Constant*
|
||||
value*__bool__€
|
||||
m
|
||||
bool_.6:x
|
||||
[ValueNode]56bool_.6:[CNode]57:62bool_.6:[CNode]57:62"REF::getattr:63:Default/getattr-op46
|
||||
Kbool_.6:[CNode]58:64bool_.6:[CNode]58:64"REF::bool_.6:[CNode]57:62:47bool_.6*
|
||||
bool_.6:x2
|
||||
bool_.6:[CNode]58:64BÎ
|
||||
œ
|
||||
bprop.3:broadcast_shape:56↱↓bprop.25:[CNode]59:65↱↓bprop.25:[CNode]59:65"REF::S-Prim-is_shape_unknown:5:$Default/S-Prim-is_shape_unknown-op48↱↓bprop.252
|
||||
↱↓bprop.25:[CNode]59:65B%↰↓bprop.242
|
||||
bprop.3:dynamic:9B¹
|
||||
<EFBFBD>
|
||||
bprop.3:dout_shape:66↱bprop.8:[CNode]60:67↱bprop.8:[CNode]60:67"REF::S-Prim-is_shape_unknown:5:$Default/S-Prim-is_shape_unknown-op50
|
||||
↱bprop.82
|
||||
↱bprop.8:[CNode]60:67B"
|
||||
↰bprop.72
|
||||
bprop.3:[CNode]4:4B¸
|
||||
Œ
|
||||
get_bprop_broadcast_to.1:dout✓bprop.17:[CNode]61:68✓bprop.17:[CNode]61:68"REF::S-Prim-MakeTuple:69:Default/S-Prim-MakeTuple-op51✓bprop.172
|
||||
✓bprop.17:[CNode]61:68B%↱bprop.132
|
||||
bprop.3:[CNode]10:10BÀ
|
||||
”
|
||||
bprop.3:x_shape:2
|
||||
bprop.3:dout_shape:66↰bprop.12:[CNode]62:70↰bprop.12:[CNode]62:70"REF::MetaFuncGraph::equal:Default/S-Prim-equal-op52↰bprop.122
|
||||
↰bprop.12:[CNode]62:70Pb
|
||||
Switch:8Switchb
|
||||
|
||||
getattr:63getattrb
|
||||
|
||||
resolve:31resolveb
|
||||
S-Prim-Shape:3S-Prim-Shapeb'
|
||||
S-Prim-MakeTuple:69S-Prim-MakeTupleb'
|
||||
S-Prim-MakeTuple:27S-Prim-MakeTupleb'
|
||||
S-Prim-MakeTuple:52S-Prim-MakeTuplebŽ
|
||||
S-Prim-is_shape_unknown:5S-Prim-is_shape_unknown1
|
||||
constexpr_module*mindspore.ops._utils.utils€%
|
||||
constexpr_name*is_shape_unknown€b'
|
||||
S-Prim-MakeTuple:39S-Prim-MakeTupleb'
|
||||
S-Prim-make_dict:45S-Prim-make_dictb'
|
||||
S-Prim-make_dict:54S-Prim-make_dictbm
|
||||
S-Prim-TensorShape:34S-Prim-TensorShape
|
||||
output_names€ŠZoutput€
|
||||
input_names€ŠZinput_x€b?
|
||||
S-Prim-BroadcastGradientArgs:58S-Prim-BroadcastGradientArgsb'
|
||||
S-Prim-MakeTuple:41S-Prim-MakeTupleb'
|
||||
S-Prim-MakeTuple:43S-Prim-MakeTupleb'
|
||||
S-Prim-MakeTuple:50S-Prim-MakeTupleh
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:í
|
||||
q%get_bprop_depth_to_space.1:[CNode]2:1%get_bprop_depth_to_space.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
>[ValueNode]4[ValueNode]4"Constant*
|
||||
value*
|
||||
block_size€
|
||||
¢
|
||||
get_bprop_depth_to_space.1:self
|
||||
[ValueNode]4%get_bprop_depth_to_space.1:[CNode]5:2%get_bprop_depth_to_space.1:[CNode]5:2"REF::getattr:3:Default/getattr-op1
|
||||
ï
|
||||
%get_bprop_depth_to_space.1:[CNode]5:2get_bprop_depth_to_space.1:op:4get_bprop_depth_to_space.1:op:4"?REF::ClassType::mindspore.ops.operations.array_ops.SpaceToDepth:CDefault/class 'mindspore.ops.operations.array_ops.SpaceToDepth'-op2get_bprop_depth_to_space.1*!
|
||||
get_bprop_depth_to_space.1:self*
|
||||
get_bprop_depth_to_space.1:x*
|
||||
get_bprop_depth_to_space.1:out*!
|
||||
get_bprop_depth_to_space.1:dout2'
|
||||
%get_bprop_depth_to_space.1:[CNode]2:1:@9dbff0a9fd1dc589c24963af4642946c62c84680ea770376abc776b4881a21c0J/grad_array_ops.pyBˆ
|
||||
r
|
||||
get_bprop_depth_to_space.1:doutbprop.3:[CNode]6:5bprop.3:[CNode]6:5"$REF::get_bprop_depth_to_space.1:op:4:3
|
||||
s
|
||||
bprop.3:[CNode]6:5bprop.3:[CNode]7:6bprop.3:[CNode]7:6"REF::S-Prim-MakeTuple:7:Default/S-Prim-MakeTuple-op4bprop.32
|
||||
bprop.3:[CNode]7:6Pb
|
||||
getattr:3getattrb&
|
||||
S-Prim-MakeTuple:7S-Prim-MakeTupleh
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:Ÿ
|
||||
g get_bprop_diag_part.1:[CNode]2:1 get_bprop_diag_part.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
®get_bprop_diag_part.1:op:2get_bprop_diag_part.1:op:2"7REF::ClassType::mindspore.ops.operations.array_ops.Diag:;Default/class 'mindspore.ops.operations.array_ops.Diag'-op1get_bprop_diag_part.1*
|
||||
get_bprop_diag_part.1:self*
|
||||
get_bprop_diag_part.1:x*
|
||||
get_bprop_diag_part.1:out*
|
||||
get_bprop_diag_part.1:dout2"
|
||||
get_bprop_diag_part.1:[CNode]2:1:@69a7faad8d2e7a5dc7baf95880108a94b60827e6a2301fc651d5021a65886178J/grad_array_ops.pyBþ
|
||||
h
|
||||
get_bprop_diag_part.1:doutbprop.3:[CNode]4:3bprop.3:[CNode]4:3"REF::get_bprop_diag_part.1:op:2:2
|
||||
s
|
||||
bprop.3:[CNode]4:3bprop.3:[CNode]5:4bprop.3:[CNode]5:4"REF::S-Prim-MakeTuple:5:Default/S-Prim-MakeTuple-op3bprop.32
|
||||
bprop.3:[CNode]5:4Pb&
|
||||
S-Prim-MakeTuple:5S-Prim-MakeTupleh
|
|
@ -0,0 +1,63 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:Ô
|
||||
g get_bprop_gather_nd.1:[CNode]2:1 get_bprop_gather_nd.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
¾get_bprop_gather_nd.1:Ñ„op:11get_bprop_gather_nd.1:Ñ„op:11"<REF::ClassType::mindspore.ops.operations.array_ops.ScatterNd:@Default/class 'mindspore.ops.operations.array_ops.ScatterNd'-op7get_bprop_gather_nd.1*
|
||||
get_bprop_gather_nd.1:self*
|
||||
get_bprop_gather_nd.1:x*!
|
||||
get_bprop_gather_nd.1:Ñ„indices*
|
||||
get_bprop_gather_nd.1:out*
|
||||
get_bprop_gather_nd.1:Ñ„dout2"
|
||||
get_bprop_gather_nd.1:[CNode]2:1:@89c21eb0121fe8f43b7e246951d5974ae8427450a42c36beac13ab0e857bb734J/grad_array_ops.pyB—
|
||||
f
|
||||
get_bprop_gather_nd.1:x
bprop.3:shp:2
bprop.3:shp:2"REF::S-Prim-Shape:3:Default/S-Prim-Shape-op1
|
||||
|
|
||||
bprop.3:shp:2bprop.3:[CNode]4:4bprop.3:[CNode]4:4"REF::S-Prim-is_shape_unknown:5:#Default/S-Prim-is_shape_unknown-op2
|
||||
_
|
||||
bprop.3:[CNode]4:4bprop.3:[CNode]5:6bprop.3:[CNode]5:6"REF::bool_.6:Default/bool_.6-op3
|
||||
w
|
||||
bprop.3:[CNode]5:6
|
||||
|
||||
✓bprop.7
|
||||
|
||||
✗bprop.8bprop.3:[CNode]9:7bprop.3:[CNode]9:7"
REF::Switch:8:Default/Switch-op4
|
||||
Fbprop.3:[CNode]10:9bprop.3:[CNode]10:9"REF::bprop.3:[CNode]9:7:5
|
||||
l
|
||||
bprop.3:[CNode]10:9bprop.3:[CNode]11:10bprop.3:[CNode]11:10"REF::↓bprop.12:Default/↓bprop.12-op6bprop.32
|
||||
bprop.3:[CNode]11:10BÝ
|
||||
|
||||
get_bprop_gather_nd.1:Ñ„indices
|
||||
get_bprop_gather_nd.1:Ñ„dout
|
||||
↓bprop.12:фshp↓bprop.12:[CNode]13:12↓bprop.12:[CNode]13:12""REF::get_bprop_gather_nd.1:фop:11:8
|
||||
´
|
||||
get_bprop_gather_nd.1:фindices↓bprop.12:[CNode]14:13↓bprop.12:[CNode]14:13".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op9
|
||||
¡
|
||||
↓bprop.12:[CNode]13:12
|
||||
↓bprop.12:[CNode]14:13↓bprop.12:[CNode]15:14↓bprop.12:[CNode]15:14"REF::S-Prim-MakeTuple:15:Default/S-Prim-MakeTuple-op10↓bprop.12*
|
||||
↓bprop.12:фshp2
|
||||
↓bprop.12:[CNode]15:14B
|
||||
after_block€ B
|
||||
✗bprop.82
|
||||
bprop.3:shp:2BŸ
|
||||
|
|
||||
get_bprop_gather_nd.1:x✓bprop.7:shp:16✓bprop.7:shp:16"REF::S-Prim-TensorShape:17:Default/S-Prim-TensorShape-op11
|
||||
✓bprop.72
|
||||
✓bprop.7:shp:16Bª
|
||||
>
[ValueNode]16
[ValueNode]16"Constant*
|
||||
value*__bool__€
|
||||
m
|
||||
bool_.6:x
|
||||
[ValueNode]16bool_.6:[CNode]17:18bool_.6:[CNode]17:18"REF::getattr:19:Default/getattr-op12
|
||||
Kbool_.6:[CNode]18:20bool_.6:[CNode]18:20"REF::bool_.6:[CNode]17:18:13bool_.6*
|
||||
bool_.6:x2
|
||||
bool_.6:[CNode]18:20Pb
|
||||
Switch:8Switchb
|
||||
|
||||
getattr:19getattrb'
|
||||
S-Prim-MakeTuple:15S-Prim-MakeTuplebŽ
|
||||
S-Prim-is_shape_unknown:5S-Prim-is_shape_unknown1
|
||||
constexpr_module*mindspore.ops._utils.utils€%
|
||||
constexpr_name*is_shape_unknown€bm
|
||||
S-Prim-TensorShape:17S-Prim-TensorShape
|
||||
output_names€ŠZoutput€
|
||||
input_names€ŠZinput_x€b
|
||||
S-Prim-Shape:3S-Prim-Shapeh
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:‚
|
||||
s#get_bprop_identity.908:[CNode]909:1#get_bprop_identity.908:[CNode]909:1"REF::bprop.910:Default/bprop.910-op737get_bprop_identity.908*
|
||||
get_bprop_identity.908:self*
|
||||
get_bprop_identity.908:x*
|
||||
get_bprop_identity.908:out*
|
||||
get_bprop_identity.908:dout2%
|
||||
#get_bprop_identity.908:[CNode]909:1:@bfa213dd499679a0e46921588aa86c02bba3ef29e44d1fd1a5e0627ad9ef8027J/grad_array_ops.pyB®
|
||||
†
|
||||
get_bprop_identity.908:doutbprop.910:[CNode]911:2bprop.910:[CNode]911:2"REF::S-Prim-MakeTuple:3:Default/S-Prim-MakeTuple-op738 bprop.9102
|
||||
bprop.910:[CNode]911:2Pb&
|
||||
S-Prim-MakeTuple:3S-Prim-MakeTupleh
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:<3A>
|
||||
o$get_bprop_masked_select.1:[CNode]2:1$get_bprop_masked_select.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
Îget_bprop_masked_select.1:op:2get_bprop_masked_select.1:op:2"CREF::ClassType::mindspore.ops.operations._grad_ops.MaskedSelectGrad:GDefault/class 'mindspore.ops.operations._grad_ops.MaskedSelectGrad'-op1get_bprop_masked_select.1*
|
||||
get_bprop_masked_select.1:self*
|
||||
get_bprop_masked_select.1:x*
|
||||
get_bprop_masked_select.1:mask*
|
||||
get_bprop_masked_select.1:out*
|
||||
get_bprop_masked_select.1:dout2&
|
||||
$get_bprop_masked_select.1:[CNode]2:1:@9a6978625e8b7ef3f5daa55341777da77b6d85cc40ea7fb58e41a065ab71ea2dJ/grad_array_ops.pyBñ
|
||||
¡
|
||||
get_bprop_masked_select.1:x
|
||||
get_bprop_masked_select.1:mask
|
||||
get_bprop_masked_select.1:doutbprop.3:dx:3bprop.3:dx:3"#REF::get_bprop_masked_select.1:op:2:2
|
||||
§
|
||||
get_bprop_masked_select.1:maskbprop.3:[CNode]4:4bprop.3:[CNode]4:4".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op3
|
||||
<EFBFBD>
|
||||
bprop.3:dx:3
|
||||
bprop.3:[CNode]4:4bprop.3:[CNode]5:5bprop.3:[CNode]5:5"REF::S-Prim-MakeTuple:6:Default/S-Prim-MakeTuple-op4bprop.32
|
||||
bprop.3:[CNode]5:5Pb&
|
||||
S-Prim-MakeTuple:6S-Prim-MakeTupleh
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:æ
|
||||
eget_bprop_non_zero.1:[CNode]2:1get_bprop_non_zero.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0get_bprop_non_zero.1*
|
||||
get_bprop_non_zero.1:self*
|
||||
get_bprop_non_zero.1:x*
|
||||
get_bprop_non_zero.1:out*
|
||||
get_bprop_non_zero.1:dout2!
|
||||
get_bprop_non_zero.1:[CNode]2:1:@fb750fba3fab4fb4e4a23b9d1eb129d5babeac456857d4e5fc621bf23c648bcfJ/grad_array_ops.pyB¶
|
||||
Ÿ
|
||||
get_bprop_non_zero.1:xbprop.3:[CNode]4:2bprop.3:[CNode]4:2".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op1
|
||||
s
|
||||
bprop.3:[CNode]4:2bprop.3:[CNode]5:3bprop.3:[CNode]5:3"REF::S-Prim-MakeTuple:4:Default/S-Prim-MakeTuple-op2bprop.32
|
||||
bprop.3:[CNode]5:3Pb&
|
||||
S-Prim-MakeTuple:4S-Prim-MakeTupleh
|
|
@ -0,0 +1,97 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:”
|
||||
|
||||
ƒ.get_bprop_resize_nearest_neighbor.1:[CNode]2:1.get_bprop_resize_nearest_neighbor.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
C
[ValueNode]21
[ValueNode]21"Constant*
|
||||
value*
align_corners€
|
||||
Ä
|
||||
(get_bprop_resize_nearest_neighbor.1:self
|
||||
[ValueNode]210get_bprop_resize_nearest_neighbor.1:[CNode]22:140get_bprop_resize_nearest_neighbor.1:[CNode]22:14"REF::getattr:15:Default/getattr-op11
|
||||
|
||||
0get_bprop_resize_nearest_neighbor.1:[CNode]22:14+get_bprop_resize_nearest_neighbor.1:Ñ„op:16+get_bprop_resize_nearest_neighbor.1:Ñ„op:16"LREF::ClassType::mindspore.ops.operations._grad_ops.ResizeNearestNeighborGrad:QDefault/class 'mindspore.ops.operations._grad_ops.ResizeNearestNeighborGrad'-op12
|
||||
ï3get_bprop_resize_nearest_neighbor.1:tensor_shape:243get_bprop_resize_nearest_neighbor.1:tensor_shape:24">REF::ClassType::mindspore.ops.operations.array_ops.TensorShape:CDefault/class 'mindspore.ops.operations.array_ops.TensorShape'-op18#get_bprop_resize_nearest_neighbor.1**
|
||||
(get_bprop_resize_nearest_neighbor.1:self*,
|
||||
*get_bprop_resize_nearest_neighbor.1:inputs*)
|
||||
'get_bprop_resize_nearest_neighbor.1:out*,
|
||||
*get_bprop_resize_nearest_neighbor.1:Ñ„dout20
|
||||
.get_bprop_resize_nearest_neighbor.1:[CNode]2:1:@37a6bd668d0ff49707b13167329bec5b82c5387018cc47b484aa32a9c57a716bJ/grad_array_ops.pyB›
|
||||
4[ValueNode]4[ValueNode]4"Constant*
|
||||
value€
|
||||
q
|
||||
[ValueNode]4bprop.3:[CNode]5:2bprop.3:[CNode]5:2"REF::MetaFuncGraph::negative:Default/S-Prim-negative-op1
|
||||
ƒ
|
||||
*get_bprop_resize_nearest_neighbor.1:inputsbprop.3:[CNode]6:3bprop.3:[CNode]6:3"REF::S-Prim-Shape:4:Default/S-Prim-Shape-op2
|
||||
|
||||
bprop.3:[CNode]5:2
|
||||
bprop.3:[CNode]6:3bprop.3:[CNode]7:5bprop.3:[CNode]7:5"REF::MetaFuncGraph::in:Default/S-Prim-in-op3
|
||||
_
|
||||
bprop.3:[CNode]7:5bprop.3:[CNode]8:6bprop.3:[CNode]8:6"REF::bool_.9:Default/bool_.9-op4
|
||||
{
|
||||
bprop.3:[CNode]8:6
|
||||
↰bprop.10
|
||||
↱bprop.11bprop.3:[CNode]12:7bprop.3:[CNode]12:7"
REF::Switch:8:Default/Switch-op5
|
||||
Gbprop.3:[CNode]13:9bprop.3:[CNode]13:9"REF::bprop.3:[CNode]12:7:6
|
||||
d
|
||||
bprop.3:[CNode]13:9bprop.3:[CNode]14:10bprop.3:[CNode]14:10"REF::bool_.9:Default/bool_.9-op7
|
||||
|
||||
bprop.3:[CNode]14:10
|
||||
✓bprop.15
|
||||
✗bprop.16bprop.3:[CNode]17:11bprop.3:[CNode]17:11"
REF::Switch:8:Default/Switch-op8
|
||||
Jbprop.3:[CNode]18:12bprop.3:[CNode]18:12"REF::bprop.3:[CNode]17:11:9
|
||||
n
|
||||
bprop.3:[CNode]18:12bprop.3:[CNode]19:13bprop.3:[CNode]19:13"REF::↓bprop.20:Default/↓bprop.20-op10bprop.32
|
||||
bprop.3:[CNode]19:13BÞ
|
||||
6
[ValueNode]23
[ValueNode]23"Constant*
|
||||
value€
|
||||
4
[ValueNode]24
[ValueNode]24"Constant*
|
||||
|
||||
value€
|
||||
4
[ValueNode]25
[ValueNode]25"Constant*
|
||||
|
||||
value€
|
||||
œ
|
||||
[ValueNode]23
|
||||
[ValueNode]24
|
||||
[ValueNode]25↓bprop.20:[CNode]26:17↓bprop.20:[CNode]26:17"REF::S-Prim-make_slice:18:Default/S-Prim-make_slice-op13
|
||||
<EFBFBD>
|
||||
↓bprop.20:фshp
|
||||
↓bprop.20:[CNode]26:17↓bprop.20:shp:19↓bprop.20:shp:19"REF::MetaFuncGraph::getitem:Default/S-Prim-getitem-op14
|
||||
ª
|
||||
*get_bprop_resize_nearest_neighbor.1:Ñ„dout
|
||||
↓bprop.20:shp:19↓bprop.20:[CNode]27:20↓bprop.20:[CNode]27:20"0REF::get_bprop_resize_nearest_neighbor.1:фop:16:15
|
||||
‡
|
||||
↓bprop.20:[CNode]27:20↓bprop.20:[CNode]28:21↓bprop.20:[CNode]28:21"REF::S-Prim-MakeTuple:22:Default/S-Prim-MakeTuple-op16↓bprop.20*
|
||||
↓bprop.20:фshp2
|
||||
↓bprop.20:[CNode]28:21B
|
||||
after_block€ Bª
|
||||
„
|
||||
*get_bprop_resize_nearest_neighbor.1:inputs✗bprop.16:shp:23✗bprop.16:shp:23"REF::S-Prim-Shape:4:Default/S-Prim-Shape-op17✗bprop.162
|
||||
✗bprop.16:shp:23B¸
|
||||
’
|
||||
*get_bprop_resize_nearest_neighbor.1:inputs✓bprop.15:shp:25✓bprop.15:shp:25"8REF::get_bprop_resize_nearest_neighbor.1:tensor_shape:24:19✓bprop.152
|
||||
✓bprop.15:shp:25Bª
|
||||
>
[ValueNode]29
[ValueNode]29"Constant*
|
||||
value*__bool__€
|
||||
m
|
||||
bool_.9:x
|
||||
[ValueNode]29bool_.9:[CNode]30:26bool_.9:[CNode]30:26"REF::getattr:15:Default/getattr-op20
|
||||
Kbool_.9:[CNode]31:27bool_.9:[CNode]31:27"REF::bool_.9:[CNode]30:26:21bool_.9*
|
||||
bool_.9:x2
|
||||
bool_.9:[CNode]31:27B<37>
|
||||
6
[ValueNode]32
[ValueNode]32"Constant*
|
||||
value€
|
||||
|
||||
[ValueNode]32↱bprop.11:[CNode]33:28↱bprop.11:[CNode]33:28"REF::MetaFuncGraph::negative:Default/S-Prim-negative-op22
|
||||
<EFBFBD>
|
||||
*get_bprop_resize_nearest_neighbor.1:inputs↱bprop.11:[CNode]34:29↱bprop.11:[CNode]34:29"REF::S-Prim-Shape:4:Default/S-Prim-Shape-op23
|
||||
˜
|
||||
↱bprop.11:[CNode]33:28
|
||||
↱bprop.11:[CNode]34:29↱bprop.11:[CNode]35:30↱bprop.11:[CNode]35:30"REF::MetaFuncGraph::in:Default/S-Prim-in-op24↱bprop.112
|
||||
↱bprop.11:[CNode]35:30B#↰bprop.102
|
||||
bprop.3:[CNode]7:5Pb
|
||||
Switch:8Switchb
|
||||
|
||||
getattr:15getattrb'
|
||||
S-Prim-MakeTuple:22S-Prim-MakeTupleb)
|
||||
S-Prim-make_slice:18S-Prim-make_sliceb
|
||||
S-Prim-Shape:4S-Prim-Shapeh
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:¿
|
||||
u'get_bprop_reverse_sequence.1:[CNode]2:1'get_bprop_reverse_sequence.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
=[ValueNode]4[ValueNode]4"Constant*
|
||||
value* batch_dim€
|
||||
;[ValueNode]5[ValueNode]5"Constant*
|
||||
value*seq_dim€
|
||||
¥
|
||||
[ValueNode]4
|
||||
[ValueNode]5'get_bprop_reverse_sequence.1:[CNode]6:2'get_bprop_reverse_sequence.1:[CNode]6:2"REF::S-Prim-MakeTuple:3:Default/S-Prim-MakeTuple-op1
|
||||
>[ValueNode]7[ValueNode]7"Constant*
|
||||
value*
|
||||
batch_dim_€
|
||||
¨
|
||||
!get_bprop_reverse_sequence.1:self
|
||||
[ValueNode]7'get_bprop_reverse_sequence.1:[CNode]8:4'get_bprop_reverse_sequence.1:[CNode]8:4"REF::getattr:5:Default/getattr-op2
|
||||
<[ValueNode]9[ValueNode]9"Constant*
|
||||
value*seq_dim_€
|
||||
ª
|
||||
!get_bprop_reverse_sequence.1:self
|
||||
[ValueNode]9(get_bprop_reverse_sequence.1:[CNode]10:6(get_bprop_reverse_sequence.1:[CNode]10:6"REF::getattr:5:Default/getattr-op3
|
||||
Þ
|
||||
'get_bprop_reverse_sequence.1:[CNode]8:4
|
||||
(get_bprop_reverse_sequence.1:[CNode]10:6(get_bprop_reverse_sequence.1:[CNode]11:7(get_bprop_reverse_sequence.1:[CNode]11:7"REF::S-Prim-MakeTuple:8:Default/S-Prim-MakeTuple-op4
|
||||
ß
|
||||
'get_bprop_reverse_sequence.1:[CNode]6:2
|
||||
(get_bprop_reverse_sequence.1:[CNode]11:7(get_bprop_reverse_sequence.1:[CNode]12:9(get_bprop_reverse_sequence.1:[CNode]12:9"REF::S-Prim-make_dict:10:Default/S-Prim-make_dict-op5
|
||||
R1313"Constant*>
|
||||
value*2mindspore.ops.operations.array_ops.ReverseSequence€!
|
||||
Ù
|
||||
13
|
||||
(get_bprop_reverse_sequence.1:[CNode]12:95get_bprop_reverse_sequence.1:reverse_sequence_grad:115get_bprop_reverse_sequence.1:reverse_sequence_grad:11"REF::MetaFuncGraph::unpack_call:Default/unpack_call.14-op6get_bprop_reverse_sequence.1*#
|
||||
!get_bprop_reverse_sequence.1:self*
|
||||
get_bprop_reverse_sequence.1:x**
|
||||
(get_bprop_reverse_sequence.1:seq_lengths*"
|
||||
get_bprop_reverse_sequence.1:out*#
|
||||
!get_bprop_reverse_sequence.1:dout2)
|
||||
'get_bprop_reverse_sequence.1:[CNode]2:1:@4ffdad088f805af1f225a28468fe395e885b035701f238182a07410dd1b86e7eJ/grad_array_ops.pyB’
|
||||
ª
|
||||
!get_bprop_reverse_sequence.1:dout
|
||||
(get_bprop_reverse_sequence.1:seq_lengths
bprop.3:dx:12
bprop.3:dx:12":REF::get_bprop_reverse_sequence.1:reverse_sequence_grad:11:7
|
||||
µ
|
||||
(get_bprop_reverse_sequence.1:seq_lengthsbprop.3:[CNode]15:13bprop.3:[CNode]15:13".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op8
|
||||
‰
|
||||
bprop.3:dx:12
|
||||
bprop.3:[CNode]15:13bprop.3:[CNode]16:14bprop.3:[CNode]16:14"REF::S-Prim-MakeTuple:15:Default/S-Prim-MakeTuple-op9bprop.32
|
||||
bprop.3:[CNode]16:14Pb
|
||||
getattr:5getattrb&
|
||||
S-Prim-MakeTuple:3S-Prim-MakeTupleb'
|
||||
S-Prim-make_dict:10S-Prim-make_dictb'
|
||||
S-Prim-MakeTuple:15S-Prim-MakeTupleb&
|
||||
S-Prim-MakeTuple:8S-Prim-MakeTupleh
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:È
|
||||
w(get_bprop_scatter_nd_update.1:[CNode]2:1(get_bprop_scatter_nd_update.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
Æ"get_bprop_scatter_nd_update.1:op:3"get_bprop_scatter_nd_update.1:op:3";REF::ClassType::mindspore.ops.operations.array_ops.GatherNd:?Default/class 'mindspore.ops.operations.array_ops.GatherNd'-op2get_bprop_scatter_nd_update.1*$
|
||||
"get_bprop_scatter_nd_update.1:self*!
|
||||
get_bprop_scatter_nd_update.1:x*'
|
||||
%get_bprop_scatter_nd_update.1:indices*&
|
||||
$get_bprop_scatter_nd_update.1:update*#
|
||||
!get_bprop_scatter_nd_update.1:out*$
|
||||
"get_bprop_scatter_nd_update.1:dout2*
|
||||
(get_bprop_scatter_nd_update.1:[CNode]2:1:@ffece89904a6a9790c35051b58c631490e55629a8853238c6ea1270bc2cc2ab0J/grad_array_ops.pyB
|
||||
®
|
||||
%get_bprop_scatter_nd_update.1:indicesbprop.3:[CNode]4:2bprop.3:[CNode]4:2".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op1
|
||||
Ÿ
|
||||
"get_bprop_scatter_nd_update.1:dout
|
||||
%get_bprop_scatter_nd_update.1:indicesbprop.3:[CNode]5:4bprop.3:[CNode]5:4"'REF::get_bprop_scatter_nd_update.1:op:3:3
|
||||
«
|
||||
"get_bprop_scatter_nd_update.1:dout
|
||||
bprop.3:[CNode]4:2
|
||||
bprop.3:[CNode]5:4bprop.3:[CNode]6:5bprop.3:[CNode]6:5"REF::S-Prim-MakeTuple:6:Default/S-Prim-MakeTuple-op4bprop.32
|
||||
bprop.3:[CNode]6:5Pb&
|
||||
S-Prim-MakeTuple:6S-Prim-MakeTupleh
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:ó
|
||||
i!get_bprop_scatter_nd.1:[CNode]2:1!get_bprop_scatter_nd.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
¸get_bprop_scatter_nd.1:op:3get_bprop_scatter_nd.1:op:3";REF::ClassType::mindspore.ops.operations.array_ops.GatherNd:?Default/class 'mindspore.ops.operations.array_ops.GatherNd'-op2get_bprop_scatter_nd.1*
|
||||
get_bprop_scatter_nd.1:self*
|
||||
get_bprop_scatter_nd.1:indices*
|
||||
get_bprop_scatter_nd.1:x*
|
||||
get_bprop_scatter_nd.1:shape*
|
||||
get_bprop_scatter_nd.1:out*
|
||||
get_bprop_scatter_nd.1:dout2#
|
||||
!get_bprop_scatter_nd.1:[CNode]2:1:@51846734a3e6eeae5e9d4d282e94fa1a0f97ae68095cdf5a9a9bce5951b5532bJ/grad_array_ops.pyBœ
|
||||
§
|
||||
get_bprop_scatter_nd.1:indicesbprop.3:[CNode]4:2bprop.3:[CNode]4:2".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op1
|
||||
Š
|
||||
get_bprop_scatter_nd.1:dout
|
||||
get_bprop_scatter_nd.1:indicesbprop.3:[CNode]5:4bprop.3:[CNode]5:4" REF::get_bprop_scatter_nd.1:op:3:3
|
||||
¥
|
||||
get_bprop_scatter_nd.1:shapebprop.3:[CNode]6:5bprop.3:[CNode]6:5".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op4
|
||||
›
|
||||
bprop.3:[CNode]4:2
|
||||
bprop.3:[CNode]5:4
|
||||
bprop.3:[CNode]6:5bprop.3:[CNode]7:6bprop.3:[CNode]7:6"REF::S-Prim-MakeTuple:7:Default/S-Prim-MakeTuple-op5bprop.32
|
||||
bprop.3:[CNode]7:6Pb&
|
||||
S-Prim-MakeTuple:7S-Prim-MakeTupleh
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:ñ
|
||||
“6get_bprop_scatter_non_aliasing_add_update.1:[CNode]2:16get_bprop_scatter_non_aliasing_add_update.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
â0get_bprop_scatter_non_aliasing_add_update.1:op:30get_bprop_scatter_non_aliasing_add_update.1:op:3";REF::ClassType::mindspore.ops.operations.array_ops.GatherNd:?Default/class 'mindspore.ops.operations.array_ops.GatherNd'-op2+get_bprop_scatter_non_aliasing_add_update.1*2
|
||||
0get_bprop_scatter_non_aliasing_add_update.1:self*/
|
||||
-get_bprop_scatter_non_aliasing_add_update.1:x*5
|
||||
3get_bprop_scatter_non_aliasing_add_update.1:indices*4
|
||||
2get_bprop_scatter_non_aliasing_add_update.1:update*1
|
||||
/get_bprop_scatter_non_aliasing_add_update.1:out*2
|
||||
0get_bprop_scatter_non_aliasing_add_update.1:dout28
|
||||
6get_bprop_scatter_non_aliasing_add_update.1:[CNode]2:1:@2c32abe9e6b9cb5a8ecb1e4f395552d49a96dc67f3121cb1b2cfe559bdb9575cJ/grad_array_ops.pyBæ
|
||||
¼
|
||||
3get_bprop_scatter_non_aliasing_add_update.1:indicesbprop.3:[CNode]4:2bprop.3:[CNode]4:2".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op1
|
||||
É
|
||||
0get_bprop_scatter_non_aliasing_add_update.1:dout
|
||||
3get_bprop_scatter_non_aliasing_add_update.1:indicesbprop.3:[CNode]5:4bprop.3:[CNode]5:4"5REF::get_bprop_scatter_non_aliasing_add_update.1:op:3:3
|
||||
¹
|
||||
0get_bprop_scatter_non_aliasing_add_update.1:dout
|
||||
bprop.3:[CNode]4:2
|
||||
bprop.3:[CNode]5:4bprop.3:[CNode]6:5bprop.3:[CNode]6:5"REF::S-Prim-MakeTuple:6:Default/S-Prim-MakeTuple-op4bprop.32
|
||||
bprop.3:[CNode]6:5Pb&
|
||||
S-Prim-MakeTuple:6S-Prim-MakeTupleh
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:Ú
|
||||
w(get_bprop_space_to_batch_nd.1:[CNode]2:1(get_bprop_space_to_batch_nd.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
?[ValueNode]4[ValueNode]4"Constant*
|
||||
value*block_shape€
|
||||
«
|
||||
"get_bprop_space_to_batch_nd.1:self
|
||||
[ValueNode]4(get_bprop_space_to_batch_nd.1:[CNode]5:2(get_bprop_space_to_batch_nd.1:[CNode]5:2"REF::getattr:3:Default/getattr-op1
|
||||
<[ValueNode]6[ValueNode]6"Constant*
|
||||
value*paddings€
|
||||
«
|
||||
"get_bprop_space_to_batch_nd.1:self
|
||||
[ValueNode]6(get_bprop_space_to_batch_nd.1:[CNode]7:4(get_bprop_space_to_batch_nd.1:[CNode]7:4"REF::getattr:3:Default/getattr-op2
|
||||
Î
|
||||
(get_bprop_space_to_batch_nd.1:[CNode]5:2
|
||||
(get_bprop_space_to_batch_nd.1:[CNode]7:46get_bprop_space_to_batch_nd.1:space_to_batch_nd_grad:56get_bprop_space_to_batch_nd.1:space_to_batch_nd_grad:5"AREF::ClassType::mindspore.ops.operations.array_ops.BatchToSpaceND:EDefault/class 'mindspore.ops.operations.array_ops.BatchToSpaceND'-op3get_bprop_space_to_batch_nd.1*$
|
||||
"get_bprop_space_to_batch_nd.1:self*!
|
||||
get_bprop_space_to_batch_nd.1:x*#
|
||||
!get_bprop_space_to_batch_nd.1:out*$
|
||||
"get_bprop_space_to_batch_nd.1:dout2*
|
||||
(get_bprop_space_to_batch_nd.1:[CNode]2:1:@b659bf9941560c8afadc8fa945c413a19a1182bf80c4dbc3a691e43a53ea882aJ/grad_array_ops.pyB‘
|
||||
€
|
||||
"get_bprop_space_to_batch_nd.1:doutbprop.3:dx:6bprop.3:dx:6";REF::get_bprop_space_to_batch_nd.1:space_to_batch_nd_grad:5:4
|
||||
m
|
||||
bprop.3:dx:6bprop.3:[CNode]8:7bprop.3:[CNode]8:7"REF::S-Prim-MakeTuple:8:Default/S-Prim-MakeTuple-op5bprop.32
|
||||
bprop.3:[CNode]8:7Pb
|
||||
getattr:3getattrb&
|
||||
S-Prim-MakeTuple:8S-Prim-MakeTupleh
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:í
|
||||
q%get_bprop_space_to_depth.1:[CNode]2:1%get_bprop_space_to_depth.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
>[ValueNode]4[ValueNode]4"Constant*
|
||||
value*
|
||||
block_size€
|
||||
¢
|
||||
get_bprop_space_to_depth.1:self
|
||||
[ValueNode]4%get_bprop_space_to_depth.1:[CNode]5:2%get_bprop_space_to_depth.1:[CNode]5:2"REF::getattr:3:Default/getattr-op1
|
||||
ï
|
||||
%get_bprop_space_to_depth.1:[CNode]5:2get_bprop_space_to_depth.1:op:4get_bprop_space_to_depth.1:op:4"?REF::ClassType::mindspore.ops.operations.array_ops.DepthToSpace:CDefault/class 'mindspore.ops.operations.array_ops.DepthToSpace'-op2get_bprop_space_to_depth.1*!
|
||||
get_bprop_space_to_depth.1:self*
|
||||
get_bprop_space_to_depth.1:x*
|
||||
get_bprop_space_to_depth.1:out*!
|
||||
get_bprop_space_to_depth.1:dout2'
|
||||
%get_bprop_space_to_depth.1:[CNode]2:1:@3e6c5f08240c11a114e82b82b7a8463fc09abb614b370aad932f63ebbd96fdb4J/grad_array_ops.pyBˆ
|
||||
r
|
||||
get_bprop_space_to_depth.1:doutbprop.3:[CNode]6:5bprop.3:[CNode]6:5"$REF::get_bprop_space_to_depth.1:op:4:3
|
||||
s
|
||||
bprop.3:[CNode]6:5bprop.3:[CNode]7:6bprop.3:[CNode]7:6"REF::S-Prim-MakeTuple:7:Default/S-Prim-MakeTuple-op4bprop.32
|
||||
bprop.3:[CNode]7:6Pb
|
||||
getattr:3getattrb&
|
||||
S-Prim-MakeTuple:7S-Prim-MakeTupleh
|
Binary file not shown.
|
@ -1,11 +0,0 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:Ì
|
||||
¼
|
||||
bprop_stop_gradient.1:x bprop_stop_gradient.1:[CNode]2:1 bprop_stop_gradient.1:[CNode]2:1".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op0
|
||||
<EFBFBD>
|
||||
bprop_stop_gradient.1:[CNode]2:1 bprop_stop_gradient.1:[CNode]3:2 bprop_stop_gradient.1:[CNode]3:2"REF::S-Prim-MakeTuple:3:Default/S-Prim-MakeTuple-op1bprop_stop_gradient.1*
|
||||
bprop_stop_gradient.1:x*
|
||||
bprop_stop_gradient.1:out*
|
||||
bprop_stop_gradient.1:dout2"
|
||||
bprop_stop_gradient.1:[CNode]3:2:@141f506cd32f226ad95f30747c497c54ce9a4c03452787e74867285f33b93439J/grad_implementations.pyPb&
|
||||
S-Prim-MakeTuple:3S-Prim-MakeTupleh
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:â
|
||||
y)get_bprop_tensor_scatter_add.1:[CNode]2:1)get_bprop_tensor_scatter_add.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
Ö*get_bprop_tensor_scatter_add.1:gather_nd:3*get_bprop_tensor_scatter_add.1:gather_nd:3";REF::ClassType::mindspore.ops.operations.array_ops.GatherNd:?Default/class 'mindspore.ops.operations.array_ops.GatherNd'-op2get_bprop_tensor_scatter_add.1*%
|
||||
#get_bprop_tensor_scatter_add.1:self*"
|
||||
get_bprop_tensor_scatter_add.1:x*(
|
||||
&get_bprop_tensor_scatter_add.1:indices*'
|
||||
%get_bprop_tensor_scatter_add.1:update*$
|
||||
"get_bprop_tensor_scatter_add.1:out*%
|
||||
#get_bprop_tensor_scatter_add.1:dout2+
|
||||
)get_bprop_tensor_scatter_add.1:[CNode]2:1:@7e173b5b89137748e6ae334dc604204428be659ee5ab7078bffa8fd37a71fc13J/grad_array_ops.pyBµ
|
||||
¯
|
||||
&get_bprop_tensor_scatter_add.1:indicesbprop.3:[CNode]4:2bprop.3:[CNode]4:2".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op1
|
||||
¯
|
||||
#get_bprop_tensor_scatter_add.1:dout
|
||||
&get_bprop_tensor_scatter_add.1:indicesbprop.3:update_grad:4bprop.3:update_grad:4"/REF::get_bprop_tensor_scatter_add.1:gather_nd:3:3
|
||||
¯
|
||||
#get_bprop_tensor_scatter_add.1:dout
|
||||
bprop.3:[CNode]4:2
|
||||
bprop.3:update_grad:4bprop.3:[CNode]5:5bprop.3:[CNode]5:5"REF::S-Prim-MakeTuple:6:Default/S-Prim-MakeTuple-op4bprop.32
|
||||
bprop.3:[CNode]5:5Pb&
|
||||
S-Prim-MakeTuple:6S-Prim-MakeTupleh
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:“
|
||||
,get_bprop_tensor_scatter_update.1:[CNode]2:1,get_bprop_tensor_scatter_update.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
Š9get_bprop_tensor_scatter_update.1:tensor_scatter_update:29get_bprop_tensor_scatter_update.1:tensor_scatter_update:2"FREF::ClassType::mindspore.ops.operations.array_ops.TensorScatterUpdate:JDefault/class 'mindspore.ops.operations.array_ops.TensorScatterUpdate'-op1
|
||||
Ü-get_bprop_tensor_scatter_update.1:gather_nd:6-get_bprop_tensor_scatter_update.1:gather_nd:6";REF::ClassType::mindspore.ops.operations.array_ops.GatherNd:?Default/class 'mindspore.ops.operations.array_ops.GatherNd'-op5!get_bprop_tensor_scatter_update.1*(
|
||||
&get_bprop_tensor_scatter_update.1:self*%
|
||||
#get_bprop_tensor_scatter_update.1:x*+
|
||||
)get_bprop_tensor_scatter_update.1:indices**
|
||||
(get_bprop_tensor_scatter_update.1:update*'
|
||||
%get_bprop_tensor_scatter_update.1:out*(
|
||||
&get_bprop_tensor_scatter_update.1:dout2.
|
||||
,get_bprop_tensor_scatter_update.1:[CNode]2:1:@8c2f7c478e1ce828147875b7eeb3e898896dea47389d946a79a1d2499b6915d8J/grad_array_ops.pyB³
|
||||
±
|
||||
(get_bprop_tensor_scatter_update.1:updatebprop.3:[CNode]4:3bprop.3:[CNode]4:3".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op2
|
||||
Î
|
||||
&get_bprop_tensor_scatter_update.1:dout
|
||||
)get_bprop_tensor_scatter_update.1:indices
|
||||
bprop.3:[CNode]4:3bprop.3:x_grad:4bprop.3:x_grad:4">REF::get_bprop_tensor_scatter_update.1:tensor_scatter_update:2:3
|
||||
²
|
||||
)get_bprop_tensor_scatter_update.1:indicesbprop.3:[CNode]5:5bprop.3:[CNode]5:5".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op4
|
||||
¸
|
||||
&get_bprop_tensor_scatter_update.1:dout
|
||||
)get_bprop_tensor_scatter_update.1:indicesbprop.3:update_grad:7bprop.3:update_grad:7"2REF::get_bprop_tensor_scatter_update.1:gather_nd:6:6
|
||||
œ
|
||||
bprop.3:x_grad:4
|
||||
bprop.3:[CNode]5:5
|
||||
bprop.3:update_grad:7bprop.3:[CNode]6:8bprop.3:[CNode]6:8"REF::S-Prim-MakeTuple:9:Default/S-Prim-MakeTuple-op7bprop.32
|
||||
bprop.3:[CNode]6:8Pb&
|
||||
S-Prim-MakeTuple:9S-Prim-MakeTupleh
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:à
|
||||
k"get_bprop_trans_shape.1:[CNode]2:1"get_bprop_trans_shape.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
¾get_bprop_trans_shape.1:op:2get_bprop_trans_shape.1:op:2"=REF::ClassType::mindspore.ops.operations.array_ops.TransShape:ADefault/class 'mindspore.ops.operations.array_ops.TransShape'-op1get_bprop_trans_shape.1*
|
||||
get_bprop_trans_shape.1:self*
|
||||
get_bprop_trans_shape.1:x*
|
||||
get_bprop_trans_shape.1:shape*
|
||||
get_bprop_trans_shape.1:out*
|
||||
get_bprop_trans_shape.1:dout2$
|
||||
"get_bprop_trans_shape.1:[CNode]2:1:@adaf31d907574c3f63f9202dc6a36f2f70f0e7caf15e7294fa4a4f2427bc8d02J/grad_array_ops.pyB¶
|
||||
r
|
||||
get_bprop_trans_shape.1:xbprop.3:[CNode]4:3bprop.3:[CNode]4:3"REF::S-Prim-Shape:4:Default/S-Prim-Shape-op2
|
||||
t
|
||||
get_bprop_trans_shape.1:dout
|
||||
bprop.3:[CNode]4:3bprop.3:dx:5bprop.3:dx:5"!REF::get_bprop_trans_shape.1:op:2:3
|
||||
¦
|
||||
get_bprop_trans_shape.1:shapebprop.3:[CNode]5:6bprop.3:[CNode]5:6".REF::MetaFuncGraph::hyper_map[zeros_like_leaf]:-Default/S-Prim-hyper_map[zeros_like_leaf]-op4
|
||||
<EFBFBD>
|
||||
bprop.3:dx:5
|
||||
bprop.3:[CNode]5:6bprop.3:[CNode]6:7bprop.3:[CNode]6:7"REF::S-Prim-MakeTuple:8:Default/S-Prim-MakeTuple-op5bprop.32
|
||||
bprop.3:[CNode]6:7Pb
|
||||
S-Prim-Shape:4S-Prim-Shapeb&
|
||||
S-Prim-MakeTuple:8S-Prim-MakeTupleh
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
0.1.1 MindSpore*2.0.0:<3A>
|
||||
aget_bprop_unique.1:[CNode]2:1get_bprop_unique.1:[CNode]2:1"REF::bprop.3:Default/bprop.3-op0
|
||||
´get_bprop_unique.1:op:2get_bprop_unique.1:op:2"=REF::ClassType::mindspore.ops.operations._grad_ops.UniqueGrad:ADefault/class 'mindspore.ops.operations._grad_ops.UniqueGrad'-op1get_bprop_unique.1*
|
||||
get_bprop_unique.1:self*
|
||||
get_bprop_unique.1:x*
|
||||
get_bprop_unique.1:out*
|
||||
get_bprop_unique.1:dout2
|
||||
get_bprop_unique.1:[CNode]2:1:@250b2c34ad30cb5948758d14a57231a58534cf4e271d6445ab7a48ae067de84dJ/grad_array_ops.pyBþ
|
||||
n
|
||||
get_bprop_unique.1:dout
|
||||
get_bprop_unique.1:outbprop.3:dx:3bprop.3:dx:3"REF::get_bprop_unique.1:op:2:2
|
||||
m
|
||||
bprop.3:dx:3bprop.3:[CNode]4:4bprop.3:[CNode]4:4"REF::S-Prim-MakeTuple:5:Default/S-Prim-MakeTuple-op3bprop.32
|
||||
bprop.3:[CNode]4:4Pb&
|
||||
S-Prim-MakeTuple:5S-Prim-MakeTupleh
|
|
@ -20,7 +20,6 @@ import numpy as np
|
|||
import mindspore.nn as nn
|
||||
from mindspore import Tensor, Parameter
|
||||
from mindspore.ops import operations as P
|
||||
import mindspore.ops.functional as F
|
||||
import mindspore.ops as ops
|
||||
import mindspore.common.dtype as mstype
|
||||
from mindspore.common.initializer import initializer
|
||||
|
@ -480,26 +479,6 @@ def test_depend():
|
|||
grad.compile(x, y)
|
||||
|
||||
|
||||
def test_stop_gradient():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the stop_gradient op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
|
||||
class StopGradientNet(nn.Cell):
|
||||
def construct(self, x, y):
|
||||
c = x * y
|
||||
c_s = F.stop_gradient(c)
|
||||
return c_s
|
||||
|
||||
x = Tensor(np.ones([4, 5]), mstype.float32)
|
||||
y = Tensor(np.ones([4, 5]), mstype.float32)
|
||||
stop_gradient = StopGradientNet()
|
||||
grad = GradNet(stop_gradient)
|
||||
grad.compile(x, y)
|
||||
|
||||
|
||||
def test_switch():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
|
@ -890,3 +869,260 @@ def test_strided_slice_grad():
|
|||
grad = GradNet(strided_slice)
|
||||
second_grad = GradNet(grad)
|
||||
second_grad.compile(x, (1, 0, 2), (3, 1, 3), (1, 1, 1))
|
||||
|
||||
|
||||
def test_sparse_gather_v2():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the sparse_gather_v2 op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
input_params = Tensor(np.array([[1, 2, 7, 42], [3, 4, 54, 22], [2, 2, 55, 3]]), mstype.float32)
|
||||
input_indices = Tensor(np.array([1, 2]), mstype.int32)
|
||||
axis = 1
|
||||
sparse_gather_v2 = Net(P.SparseGatherV2())
|
||||
grad = GradNet(sparse_gather_v2)
|
||||
grad.compile(input_params, input_indices, axis)
|
||||
|
||||
|
||||
def test_resize_nearest_neighbor():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the resize_nearest_neighbor op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.array([[[[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]]]), mstype.float32)
|
||||
resize_nearest_neighbor = Net(P.ResizeNearestNeighbor((2, 2)))
|
||||
grad = GradNet(resize_nearest_neighbor)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_gather_nd():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the gather_nd op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]), mstype.float32)
|
||||
indices = Tensor(np.array([[0, 0], [1, 1]]), mstype.int32)
|
||||
gather_nd = Net(P.GatherNd())
|
||||
grad = GradNet(gather_nd)
|
||||
grad.compile(x, indices)
|
||||
|
||||
|
||||
def test_scatter_nd():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the scatter_nd op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
indices = Tensor(np.array([[0], [2]]), mstype.int32)
|
||||
updates = Tensor(np.array([[[1, 1, 1, 1], [2, 2, 2, 2],
|
||||
[3, 3, 3, 3], [4, 4, 4, 4]],
|
||||
[[1, 1, 1, 1], [2, 2, 2, 2],
|
||||
[3, 3, 3, 3], [4, 4, 4, 4]]]), mstype.float32)
|
||||
shape = (4, 4, 4)
|
||||
scatter_nd = Net(P.ScatterNd())
|
||||
grad = GradNet(scatter_nd)
|
||||
grad.compile(indices, updates, shape)
|
||||
|
||||
|
||||
def test_scatter_nd_update():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the scatter_nd_update op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
np_x = np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]])
|
||||
input_x = Parameter(Tensor(np_x, mstype.float32), name="x")
|
||||
indices = Tensor(np.array([[0, 0], [1, 1]]), mstype.int32)
|
||||
updates = Tensor(np.array([1.0, 2.2]), mstype.float32)
|
||||
scatter_nd_update = Net(P.ScatterNdUpdate())
|
||||
grad = GradNet(scatter_nd_update)
|
||||
grad.compile(input_x, indices, updates)
|
||||
|
||||
|
||||
def test_scatter_non_aliasing_add():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the scatter_non_aliasing_add op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
input_x = Parameter(Tensor(np.array([1, 2, 3, 4, 5, 6, 7, 8]), mstype.float32), name="x")
|
||||
indices = Tensor(np.array([[2], [4], [1], [7]]), mstype.int32)
|
||||
updates = Tensor(np.array([6, 7, 8, 9]), mstype.float32)
|
||||
scatter_non_aliasing_add = Net(P.ScatterNonAliasingAdd())
|
||||
grad = GradNet(scatter_non_aliasing_add)
|
||||
grad.compile(input_x, indices, updates)
|
||||
|
||||
|
||||
def test_tensor_scatter_update():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the tensor_scatter_update op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
input_x = Tensor(np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]), mstype.float32)
|
||||
indices = Tensor(np.array([[0, 0], [1, 1]]), mstype.int32)
|
||||
update = Tensor(np.array([1.0, 2.2]), mstype.float32)
|
||||
tensor_scatter_update = Net(P.TensorScatterUpdate())
|
||||
grad = GradNet(tensor_scatter_update)
|
||||
grad.compile(input_x, indices, update)
|
||||
|
||||
|
||||
def test_tensor_scatter_add():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the tensor_scatter_add op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
input_x = Tensor(np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]), mstype.float32)
|
||||
indices = Tensor(np.array([[0, 0], [0, 0]]), mstype.int32)
|
||||
updates = Tensor(np.array([1.0, 2.2]), mstype.float32)
|
||||
tensor_scatter_add = Net(P.TensorScatterAdd())
|
||||
grad = GradNet(tensor_scatter_add)
|
||||
grad.compile(input_x, indices, updates)
|
||||
|
||||
|
||||
def test_space_to_depth():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the space_to_depth op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.random.rand(1, 3, 2, 2), mstype.float32)
|
||||
block_size = 2
|
||||
space_to_depth = Net(P.SpaceToDepth(block_size))
|
||||
grad = GradNet(space_to_depth)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_depth_to_space():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the depth_to_space op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.random.rand(1, 12, 1, 1), mstype.float32)
|
||||
block_size = 2
|
||||
depth_to_space = Net(P.DepthToSpace(block_size))
|
||||
grad = GradNet(depth_to_space)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_diag_part():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the diag_part op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor([[1, 0, 0, 0],
|
||||
[0, 2, 0, 0],
|
||||
[0, 0, 3, 0],
|
||||
[0, 0, 0, 4]])
|
||||
diag_part = Net(P.DiagPart())
|
||||
grad = GradNet(diag_part)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_space_to_batch_nd():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the space_to_batch_nd op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
block_size = 2
|
||||
paddings = [[0, 0], [0, 0]]
|
||||
x = Tensor(np.array([[[[1, 2], [3, 4]]]]), mstype.float32)
|
||||
space_to_batch_nd = Net(P.SpaceToBatchND(block_size, paddings))
|
||||
grad = GradNet(space_to_batch_nd)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_batch_to_space_nd():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the batch_to_space_nd op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
block_size = 2
|
||||
crops = [[0, 0], [0, 0]]
|
||||
x = Tensor(np.array([[[[1]]], [[[2]]], [[[3]]], [[[4]]]]), mstype.float32)
|
||||
batch_to_space_nd = Net(P.BatchToSpaceND(block_size, crops))
|
||||
grad = GradNet(batch_to_space_nd)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_broadcast_to():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the broadcast_to op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
shape = (2, 3)
|
||||
x = Tensor(np.array([1, 2, 3]).astype(np.float32))
|
||||
broadcast_to = Net(P.BroadcastTo(shape))
|
||||
grad = GradNet(broadcast_to)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_reverse_sequence():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the reverse_sequence op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), mstype.float32)
|
||||
seq_lengths = Tensor(np.array([1, 2, 3]))
|
||||
reverse_sequence = Net(P.ReverseSequence(seq_dim=1))
|
||||
grad = GradNet(reverse_sequence)
|
||||
grad.compile(x, seq_lengths)
|
||||
|
||||
|
||||
def test_trans_shape():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the trans_shape op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
shape = (3, 1)
|
||||
x = Tensor(np.array([1, 2, 3]).astype(np.float32))
|
||||
trans_shape = Net(P.TransShape())
|
||||
grad = GradNet(trans_shape)
|
||||
grad.compile(x, shape)
|
||||
|
||||
|
||||
def test_trans_unique():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the unique op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.array([1, 2, 5, 2]), mstype.int32)
|
||||
unique = Net(P.Unique())
|
||||
grad = GradNet(unique)
|
||||
grad.compile(x)
|
||||
|
||||
|
||||
def test_masked_select():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the masked_select op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.array([1, 2, 3, 4]), mstype.int32)
|
||||
mask = Tensor(np.array([1, 0, 1, 0]), mstype.bool_)
|
||||
masked_select = Net(P.MaskedSelect())
|
||||
grad = GradNet(masked_select)
|
||||
grad.compile(x, mask)
|
||||
|
||||
|
||||
def test_non_zero():
|
||||
"""
|
||||
Feature: Bprop pre-compilation.
|
||||
Description: Compile the backward graph for the non_zero op.
|
||||
Expectation: Load the bprop mindir successfully.
|
||||
"""
|
||||
x = Tensor(np.array([[[1, 0], [-5, 0]]]), mstype.int32)
|
||||
grad = GradNet(ops.nonzero)
|
||||
grad.compile(x)
|
||||
|
|
Loading…
Reference in New Issue