Browse Source

set abstract for maketuple

tags/v1.2.0-rc1
yangwei 4 years ago
parent
commit
e34b2873fa
2 changed files with 3 additions and 0 deletions
  1. +1
    -0
      mindspore/ccsrc/backend/session/session_basic.cc
  2. +2
    -0
      tests/st/control/test_switch_layer.py

+ 1
- 0
mindspore/ccsrc/backend/session/session_basic.cc View File

@@ -1049,6 +1049,7 @@ std::vector<AnfNodePtr> SessionBasic::CreateCallSwitchLayerInputs(const CNodePtr
new_make_tuple_inputs.emplace_back(new_partial);
}
auto new_make_tuple = graph->NewCNode(new_make_tuple_inputs);
new_make_tuple->set_abstract(make_tuple_node->abstract());
switch_layer_inputs.emplace_back(new_make_tuple);
auto new_switch_layer = graph->NewCNode(switch_layer_inputs);
cnode_inputs.emplace_back(new_switch_layer);


+ 2
- 0
tests/st/control/test_switch_layer.py View File

@@ -38,6 +38,8 @@ class CaseNet(nn.Cell):


@pytest.mark.level0
@pytest.mark.platform_arm_ascend_training
@pytest.mark.platform_x86_ascend_training
@pytest.mark.platform_x86_gpu_training
@pytest.mark.env_onecard
def test_switch_layer():


Loading…
Cancel
Save