Browse Source

sync-device-data-type-to-return-tensor

tags/v0.7.0-beta
lvliang 5 years ago
parent
commit
45745c527e
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      mindspore/ccsrc/backend/session/session_basic.cc

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

@@ -86,7 +86,10 @@ BaseRef CreateOneTensor(const AnfNodePtr &node, size_t output_index, const Kerne
MS_EXCEPTION_IF_NULL(address);
auto shape = AnfAlgo::GetOutputInferShape(node, output_index);
TypeId type_id = kNumberTypeFloat32;
type_id = AnfAlgo::GetOutputInferDataType(node, output_index);
type_id = AnfAlgo::GetOutputDeviceDataType(node, output_index);
if (type_id == kTypeUnknown) {
type_id = AnfAlgo::GetOutputInferDataType(node, output_index);
}
std::vector<int> temp_shape;
if (graph.IsInternalOutput(node, output_index)) {
temp_shape.emplace_back(1);


Loading…
Cancel
Save