加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
input.txt 8.09 KB
一键复制 编辑 原始数据 按行查看 历史
TAJh 提交于 2024-08-27 20:34 . 1234
# IR entry: @19_1___main___Net_construct_304
# Total subgraphs: 3
# Attrs:
has_shard: 0
has_attached: 1
jit_level: O0
check_set_strategy_valid_once_only: 1
FLASH_SP_RUN_ONCE_ONLY: 1
pynative_run_in_graph: 0
less_bn: 0
auto_parallel_finish_pre_action: 1
# Total params: 2
# Params:
%para1_x: <Tensor[Float32], ()> : []
%para2_y: <Tensor[Float32], ()> : []
Node counting information:
Total number of nodes: 29
Total number of cnodes: 12
subgraph attr:
has_shard: 0
has_attached: 1
jit_level: O0
check_set_strategy_valid_once_only: 1
FLASH_SP_RUN_ONCE_ONLY: 1
pynative_run_in_graph: 0
less_bn: 0
auto_parallel_finish_pre_action: 1
subgraph instance: 19_1___main___Net_construct_304 : 0x135400418
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
subgraph @19_1___main___Net_construct_304() {
%0(CNode_310$a) = PrimFunc_Sub(%para1_x, Tensor(shape=[], dtype=Float32, value=1), I64(0)) cnode_attrs: {checkpoint: Bool(1), is_dynamic_len: Bool(0)}
: (<Tensor[Float32], ()>, <Tensor[Float32], (), value=...>) -> (<Tensor[Float32], ()>)
# Fullname with scope: (Default/Sub-op1)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:16, 12~25/ a = ops.sub(x, 1)/
# In file t6.py:16, 12~19/ a = ops.sub(x, 1)/<~~This line of code can be shared by multiple nodes, and may be duplicated./
# In file /workspace/mindspore/build/package/mindspore/ops/auto_generate/gen_ops_def.py:5251~5294, 0~31/def sub(input, other):/
# In file /workspace/mindspore/build/package/mindspore/ops/auto_generate/gen_ops_def.py:5294, 11~31/ return sub_op(input, other)/
%1(CNode_309$b) = PrimFunc_Add(%0, Tensor([1,2,3], dtype=ms.Int64)) cnode_attrs: {checkpoint: Bool(1), is_dynamic_len: Bool(0)}
: (<Tensor[Float32], ()>, <Tensor[Float32], ()>) -> (<Tensor[Float32], ()>)
# Fullname with scope: (Default/Add-op1)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:17, 12~25/ b = ops.add(a, y)/
# In file t6.py:17, 12~19/ b = ops.add(a, y)/<~~This line of code can be shared by multiple nodes, and may be duplicated./
# In file /workspace/mindspore/build/package/mindspore/ops/auto_generate/gen_ops_def.py:183~241, 0~31/def add(input, other):/
# In file /workspace/mindspore/build/package/mindspore/ops/auto_generate/gen_ops_def.py:241, 11~31/ return add_op(input, other)/
%2(CNode_308) = PrimFunc_Cast(%1, I64(30)) primitive_attrs: {output_names: [output], input_names: [x, dst_type]} cnode_attrs: {checkpoint: Bool(1), is_dynamic_len: Bool(0)}
: (<Tensor[Float32], ()>, <Int64, NoShape>) -> (<Tensor[Bool], ()>)
# Fullname with scope: (Default/Cast-op1)
# In file /workspace/mindspore/build/package/mindspore/_extends/parse/standard_method.py:2747~2749, 0~23/def bool_(x):/
# In file /workspace/mindspore/build/package/mindspore/_extends/parse/standard_method.py:2749, 11~23/ return x.__bool__()/
# In file /workspace/mindspore/build/package/mindspore/_extends/parse/standard_method.py:2749, 11~21/ return x.__bool__()/<~~This line of code can be shared by multiple nodes, and may be duplicated./
# In file /workspace/mindspore/build/package/mindspore/_extends/parse/standard_method.py:3267~3272, 0~34/def tensor_bool(x):/
# In file /workspace/mindspore/build/package/mindspore/_extends/parse/standard_method.py:3270~3271, 4~38/ if is_cond and F.isconstant(x):/
# In file /workspace/mindspore/build/package/mindspore/_extends/parse/standard_method.py:3272, 11~34/ return F.cast(x, mstype.bool_)/<~~This line of code can be shared by multiple nodes, and may be duplicated./
%3(CNode_317) = Partial(@20_4_✓__main___Net_construct_311, %1, %0) primitive_attrs: {side_effect_propagate: I64(1)} cnode_attrs: {checkpoint: Bool(1)}
: (<Func, NoShape>, <Tensor[Float32], ()>, <Tensor[Float32], ()>) -> (<Func, NoShape>)
# Fullname with scope: (Default/Partial-op0)
%4(CNode_316) = Partial(@21_14_✗__main___Net_construct_314, %1) primitive_attrs: {side_effect_propagate: I64(1)} cnode_attrs: {checkpoint: Bool(1)}
: (<Func, NoShape>, <Tensor[Float32], ()>) -> (<Func, NoShape>)
# Fullname with scope: (Default/Partial-op1)
%5(ValueNode_307) = Switch(%2, %3, %4) cnode_attrs: {checkpoint: Bool(1)}
: (<Tensor[Bool], ()>, <Func, NoShape>, <Func, NoShape>) -> (<Func, NoShape>)
# Fullname with scope: (Default/Switch-op4)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:18~19, 8~43/ if b :/
%6(CNode_306) = %5[@FuncUnion(@20_4_✓__main___Net_construct_311, @21_14_✗__main___Net_construct_314)]()
: () -> (<Tensor[Float32], ()>)
# Fullname with scope: (5)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:18~19, 8~43/ if b :/
Return(%6) cnode_attrs: {checkpoint: Bool(1)}
: (<Tensor[Float32], ()>)
# Fullname with scope: (Default/Return-op19)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:18~19, 8~43/ if b :/
}
indirect: 1
subgraph attr:
defer_inline: 0
undeterminate: 0
subgraph instance: 20_4_✓__main___Net_construct_311 : 0x135400a18
# Parameters: 2, (<Tensor[Float32], ()>, <Tensor[Float32], ()>)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
subgraph @20_4_✓__main___Net_construct_311(%para3_Parameter_320, %para4_Parameter_319) {
%0(output) = PrimFunc_Div(%para4_Parameter_319, %para3_Parameter_320)
: (<Tensor[Float32], ()>, <Tensor[Float32], ()>) -> (<Tensor[Float32], ()>)
# Fullname with scope: (Default/Div-op1)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:19, 27~42/ b = ops.mul(b, self.func(a, b))/
# In file t6.py:19, 27~36/ b = ops.mul(b, self.func(a, b))/<~~This line of code can be shared by multiple nodes, and may be duplicated./
# In file t6.py:12~13, 4~28/ def func(x, y):/
# In file t6.py:13, 15~28/ return ops.div(x, y)/
# In file t6.py:13, 15~22/ return ops.div(x, y)/<~~This line of code can be shared by multiple nodes, and may be duplicated./
# In file /workspace/mindspore/build/package/mindspore/ops/function/math_func.py:707~766, 0~17/def div(input, other, *, rounding_mode=None):/
# In file /workspace/mindspore/build/package/mindspore/ops/function/math_func.py:762~765, 4~38/ if rounding_mode:/
# In file /workspace/mindspore/build/package/mindspore/ops/function/math_func.py:765, 17~38/ output = P.Div()(input, other)/<~~This line of code can be shared by multiple nodes, and may be duplicated./
%1(CNode_313$b) = PrimFunc_Mul(%para3_Parameter_320, %0) cnode_attrs: {is_dynamic_len: Bool(0)}
: (<Tensor[Float32], ()>, <Tensor[Float32], ()>) -> (<Tensor[Float32], ()>)
# Fullname with scope: (Default/Mul-op1)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:19, 16~43/ b = ops.mul(b, self.func(a, b))/
# In file t6.py:19, 16~23/ b = ops.mul(b, self.func(a, b))/<~~This line of code can be shared by multiple nodes, and may be duplicated./
# In file /workspace/mindspore/build/package/mindspore/ops/auto_generate/gen_ops_def.py:3471~3518, 0~31/def mul(input, other):/
# In file /workspace/mindspore/build/package/mindspore/ops/auto_generate/gen_ops_def.py:3518, 11~31/ return mul_op(input, other)/
Return(%1)
: (<Tensor[Float32], ()>)
# Fullname with scope: (Default/Return-op20)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:19, 12~43/ b = ops.mul(b, self.func(a, b))/
}
indirect: 1
subgraph attr:
defer_inline: 0
undeterminate: 0
subgraph instance: 21_14_✗__main___Net_construct_314 : 0x1353ff218
# Parameters: 1, (<Tensor[Float32], ()>)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
subgraph @21_14_✗__main___Net_construct_314(%para5_Parameter_322) {
Return(%para5_Parameter_322)
: (<Tensor[Float32], ()>)
# Fullname with scope: (Default/Return-op21)
# In file t6.py:15~20, 4~16/ def construct(self, x, y):/
# In file t6.py:18~19, 8~43/ if b :/
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化